XAP66 == "XAP9NET" || XAP66 == "XAP9" || XAP66 == "XAP9NET")

JMS

Search XAP 6.6
Searching XAP 6.6 Documentation
Browse XAP 6.6
Offline Documentation

Download latest offline documentation in HTML format:
xap-6.6.1-documentation.zip (20.6MB)

                                                              

Section Summary: GigaSpaces allows applications to use the space as a messaging hub. Applications use JMS to create topics and queues as usual; these are transparently translated into space Entries.

Overview

GigaSpaces offers a virtual JMS implementation, built on top of the core JavaSpaces layer.

JMS messages are implemented as externalizable MetaDataEntries, indexed, and routed to the space according to the destination name.

Since GigaSpaces XAP 6.0, the JMS implementation supports the unified messaging model, introduced in version 1.1 of the JMS specification.

JMS Domains

JMS 1.0.2 introduced two domains:

  • Point to Point – in this domain, a producer sends messages to a destination of type Queue. Each message is consumed by only one consumer.
  • Publish/Subscribe – in this domain, a producer publishes messages to a destination of type Topic. Any consumer that listens on that Topic receives the messages.

In JMS 1.0.2, each domain used a separate set of interfaces.

JMS 1.1 presents the unified model, that unites the usage of both domains under a single set of interfaces.

GigaSpaces XAP 6.0 JMS implementation supports both the unified model, and the separate domains.

Basic JMS Workflow

  1. Obtain/create a ConnectionFactory instance.
  2. Create a Connection with the ConnectionFactory.
  3. Create a Session with the Connection.
  4. Obtain/create a Destination (Topic or Queue).
  5. Message production:
    1. Create MessageProducers with the Session and the destination.
    2. Create a Message with the Session.
    3. Send the Message with the MessageProducer.
  6. Message Consumption:
    1. Create MessageConsumers with the Session and the destination.
    2. Enable connection message consumption by calling the Connection.start() method.
    3. For synchronous consumption, call the MessageConsumer.receive() method.
    4. For asynchronous consumption, set the MessageConsumer MessageListener, and implement the onMessage() method.
  7. When the application finishes, release all resources by closing the connection.

Using Unified Messaging Model (JMS 1.1)

Click to see the code example:

Using Separate Domains (JMS 1.0.2)

Publish/Subscribe

Click to see the code example:

Point to Point

Click to see the code example:

Section Contents

IMPORTANT: This is an old version of GigaSpaces XAP. Click here for the latest version.

Labels