Creating TopicSubscriber

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: A JMS client subscribes to a topic with a TopicSubscriber.

Overview

A JMS client subscribes to a topic with a TopicSubscriber, created from the TopicSession object using one of a diversity of methods. Choose a certain method depending on:

  • Whether the subscription is either non-durable or durable.
  • Whether or not you wish to specify a message selector.

The most conventional method to create a non-durable subscription is:

TopicSubscriber createSubscriber(Topic topic)
// topicSession is an instance of TopicSession
// topic is an instance of Topic
TopicSubscriber subscriber =
topicSession.createSubscriber(topic);

To specify a message selector, use the following text string that defines the criteria needed to filter incoming messages.

TopicSubscriber createSubscriber(Topic topic, String
messageSelector, Boolean nolocal)
For more details about JMS message selectors, refer to: Message Selectors.

To create a durable subscription according to JMS specifications, use either of the following two methods:

TopicSubscriber createDurableSubscriber(Topic topic, String
subscriptionName)
TopicSubscriber createDurableSubscriber(Topic topic, String
subscriptionName,String messageSelector, Boolean nolocal)
For more details about durable subscriptions, refer to: Durable Subscriptions.

After you've created a TopicPublisher, you can receive messages, either synchronously or asynchronously.


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)