Broker 10.5 | webMethods Broker Documentation | webMethods Broker Messaging Programmer's Guide | Coding Messaging Client Applications | C# Messaging Clients | Application Code | Implementing an Asynchronous Message Listener
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);
The MessageListener delegate receives the incoming customer request messages asynchronously from the requestor application.