Assembly: TIBCO.EMS.UFO (in TIBCO.EMS.UFO.dll)
Syntax
public class MessageConsumer |
Public Class MessageConsumer |
public ref class MessageConsumer |
Remarks
MessageConsumer is the parent interface for all message consumers.
A MessageConsumer object is created by passing a Destination object to a message-consumer creation method supplied by a session. A message consumer can be created with a message selector that allows the client to restrict the messages delivered to the message consumer to those that match the selector.
A client may either synchronously receive a message consumer's messages or have the consumer asynchronously deliver them as they arrive.
For synchronous receipt, a client can request the next message from a message consumer using one of its receive methods. There are several variations of receive that allow a client to poll or wait for the next message.
Consumers can receive messages asynchronously in either of two idioms. Programmers may select either idiom—but not both (which would cause duplicate message processing, with undefined behavior).
- MessageHandler - see EMSMessageHandler for more information. The client library raises an event when a message arrives at the destination. The program implements a handler delegate to processes it asynchronously, and registers the delegate here.
- MessageListener - see IMessageListener for more information. A client can register a MessageListener object with a message consumer. When a message arrives, the client library calls this listener’s onMessage method with the message as its argument. The program implements the message listener interface, and registers a message listener object by setting this property. The MessageListener mimics the way in which JMS provides similar functionality in a Java programming idiom
A message selector restricts the set of messages that the consumer receives to those that match the selector. Programs can set this property only when creating the consumer object; see Session.CreateConsumer.
It is a client programming error for a MessageListener to throw an exception.
Inheritance Hierarchy
TIBCO.EMS.UFO..::.MessageConsumer
TIBCO.EMS.UFO..::.QueueReceiver
TIBCO.EMS.UFO..::.TopicSubscriber