WebLogic Messaging API Class Library

ISession.CreateConsumer\xA0Method\xA0(IDestination, String, Boolean)

Creates IMessageConsumer for the specified destination, using a message selector. This method can specify whether messages published by its own connection should be delivered to it, if the destination is a topic.

Since IQueue and ITopic both inherit from IDestination, they can be used in the destination parameter to create a IMessageConsumer.

A client uses a IMessageConsumer object to receive messages that have been published to a destination.

In some cases, a connection may both publish and subscribe to a topic. The consumer NoLocal attribute allows a consumer to inhibit the delivery of messages published by its own connection. The default value for this attribute is False. The noLocal value is supported by destinations that are topics.

IMessageConsumer\xA0CreateConsumer(
\xA0\xA0\xA0IDestination\xA0destination,
\xA0\xA0\xA0String\xA0messageSelector,
\xA0\xA0\xA0Boolean\xA0noLocal
);

Parameters

IDestination
the IDestination to access
String
only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Boolean
- if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue.

Return Value

An IMessageConsumer for the specified destination

Exceptions

Exception TypeCondition
MessageExceptionif the session fails to create a IMessageConsumer due to some internal error.
InvalidDestinationExceptionif an invalid destination is specified.
InvalidSelectorExceptionif the message selector is invalid.

See Also

ISession Interface | WebLogic.Messaging Namespace | ISession. Overload List | Message selector syntax.