[TIBCO.EMS .NET client library 7.0 documentation]
Assembly: TIBCO.EMS (in TIBCO.EMS.dll)
The message event handler for asynchronous message consumption.
Namespace:
TIBCO.EMSAssembly: TIBCO.EMS (in TIBCO.EMS.dll)
Syntax
public event EMSMessageHandler MessageHandler |
Public Event MessageHandler As EMSMessageHandler |
public: event EMSMessageHandler^ MessageHandler { void add (EMSMessageHandler^ value); void remove (EMSMessageHandler^ value); } |
Remarks
The client library raises an event when a message arrives at the destination. The program implements a handler delegate to processes it asynchronously.
The Delegate declaration for message event handler is as follows:![]() | |
---|---|
public delegate void EMSMessageHandler(object sender, EMSMessageEventArgs args); |
Examples
Example of using the message event handler:
User should either use MessageHandler or MessageListener
to handle asynchronous message consumptions, but not both.
Setting up both will cause the message to be handled more than once
which can result in undefined behavior ![]() | |
---|---|
... consumer.MessageHandler += new EMSMessageHandler(handleMsg); ... private void handleMsg(object sender, EMSMessageEventArgs arg) { Message m = arg.Message; Console.WriteLine("Received message: " + m); } ... |
Exceptions
Exception | Condition |
---|---|
TIBCO.EMS..::.IllegalStateException | If the consumer is closed |