|
Summary: Receiving a message asynchronously, by creating an object that implements MessageListener and registering it with the TopicSubscriber.
OverviewTo receive a message asynchronously, create an object that implements the MessageListener interface and register it with the TopicSubscriber using the method setMessageListener(). See the example below: void setMessageListener(MessageListener listener) The MessageListener interface describes one method, onMessage(), called whenever a message arrives. // subscriber is an instance of TopicSubscriber subscriber.setMessageListener(new MessageListener() { public void onMessage(javax.jms.Message message) { // process the message } }); |
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.
Labels
(None)
Add Comment