Receiving JMS Messages Asynchronously

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: Receiving a message asynchronously, by creating an object that implements MessageListener and registering it with the TopicSubscriber.

Overview

To 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)