The message event handler for asynchronous message consumption.
The event handler receives an argument of type EMSMessageEventArgs containing data related to this event. The following EMSMessageEventArgs property provides information specific to this event.
Property | Description |
---|---|
Message | Get the Message which caused the event |
The Delegate declaration for message event handler is as follows:
public delegate void EMSMessageHandler(object sender, EMSMessageEventArgs args);
sender: The source of the event. It can be either the MessageConsumer object or the Session object depending on to which object is the message handler registered.
args: The event argument, EMSMessageEventArgs
... consumer.MessageHandler += new EMSMessageHandler(handleMsg); ... private void handleMsg(object sender, EMSMessageEventArgs arg) { Message m = arg.Message; Console.WriteLine("Received message: " + m); } ...
Exception Type | Condition |
---|---|
IllegalStateException | If the consumer is closed |
MessageConsumer Class | TIBCO.EMS Namespace