Broker 10.5 | webMethods Broker Documentation | webMethods Broker Messaging Programmer's Guide | Coding Messaging Client Applications | A Basic JMS Sender-Receiver Client | Coding Messaging Objects | Message Receiver
 
Message Receiver
Following is the code used to create the messaging objects in the receiver application:

conn = factory.createConnection();
Session session = conn.createSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageConsumer receiver = session.createConsumer(destination);
You define the connection and session objects the same as for the message sender application. However, the message receiver defines a message consumer rather than a message producer. The message consumer is created calling createConsumer() on the session.