An application uses a message consumer to receive messages sent to a destination.
IBM.XMS.IPropertyContext | +----IBM.XMS.IMessageConsumer
For a list of the XMS defined properties of a MessageConsumer object, see Properties of MessageConsumer.
.NET property | Description |
---|---|
MessageListener | Get the message listener that is registered with the message consumer, and register a message listener with the message consumer. |
MessageSelector | Get the message selector for the message consumer. |
MessageListener MessageListener { get; set; }
Get the message listener that is registered with the message consumer, and register a message listener with the message consumer.
If no message listener is registered with the message consumer, MessageListener is null. If a message listener is already registered with the message consumer, you can cancel the registration by specifying a null instead.
For more information about using message listeners, see Using message and exception listeners in .NET.
String MessageSelector { get; }
Get the message selector for the message consumer. The return value is a String object encapsulating the message selector expression. If data conversion is required, this is the message selector expression after conversion. If the message consumer does not have a message selector, the value of MessageSelector is a null String object.
Method | Description |
---|---|
Close | Close the message consumer. |
Receive | Receive the next message for the message consumer. The call waits indefinitely for a message, or until the message consumer is closed. |
Receive | Receive the next message for the message consumer. The call waits only a specified period of time for a message, or until the message consumer is closed. |
ReceiveNoWait | Receive the next message for the message consumer if one is available immediately. |
IMessage Receive();
Receive the next message for the message consumer. The call waits indefinitely for a message, or until the message consumer is closed.
IMessage Receive(Int64 delay);
Receive the next message for the message consumer. The call waits only a specified period of time for a message, or until the message consumer is closed.