WebLogic Messaging API Class Library

ISession.CreateConsumer Method (IDestination, String)

Creates an IMessageConsumer for the specified destination, using a message selector. 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 sent to a destination.

IMessageConsumer CreateConsumer(
   IDestination destination,
   String messageSelector


the IDestination to access
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.

Return Value

An IMessageConsumer for the specified destination


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.