IMessageConsumer
An application uses a message consumer to receive messages sent to a destination.
- Inheritance hierarchy:
-
IBM.XMS.IPropertyContext | +----IBM.XMS.IMessageConsumer
For a list of the XMS defined properties of a MessageConsumer object, see Properties of MessageConsumer.
Parent topic: .NET interfaces.NET properties
- Summary of .NET properties:
-
.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.
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,
we can cancel the registration by specifying a null instead. For more information about using message listeners, see Use message and
exception listeners in .NET.
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 value 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.
Close the message
consumer. If an application tries to close a message consumer
that is already closed, the call is ignored.
Receive the next message
for the message consumer. The call waits indefinitely for a message,
or until the message consumer is closed.
Receive the next
message for the message consumer. The call waits only a specified
period for a message, or until the message consumer is closed.
Receive the next message
for the message consumer if one is available immediately.
MessageListener - Get and Set Message Listener
MessageListener MessageListener
{
get;
set;
}
MessageSelector - Get Message Selector
String MessageSelector
{
get;
}
Methods
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 for a message, or until the message consumer is closed.
ReceiveNoWait
Receive the next message
for the message consumer if one is available immediately.
Close - Close Message Consumer
void Close();
Receive - Receive
IMessage Receive();
Receive - Receive (with a wait interval)
IMessage Receive(Int64 delay);
ReceiveNoWait - Receive with No Wait
IMessage ReceiveNoWait();
Inherited properties and methods
The following methods are inherited from the IPropertyContext interface: