Implementing an Asynchronous Message Listener
The ServerApplication class implements a single asynchronous message listener to receive customer inquiries. The message listener is implemented through the C# MessageListener and MessageConsumer interfaces.
class ServerApplication : samples.RequestReply.SimpleApplication
{
IConnection conn = null;
ISession session;
IMessageProducer sender;
IMessageConsumer receiver;
ISession adminSession;
IMessageConsumer adminReceiver;
. . .
receiver.MessageListener = new MessageListener(OnMessage);
conn.Start();
The MessageListener delegate receives the incoming customer request messages asynchronously from the requestor application.