Overview
GigaSpaces offers a virtual JMS implementation, built on top of the core JavaSpaces layer. The JMS implementation is basically a client-side view of specific objects in a space. This associative approach is a key factor in enabling the virtualization of a queue or a topic. In general, a queue or a topic is mapped to a set of objects of a specific class name – the queue/topic name ordered at the time they were written.
Basic JMS Workflow
Applications using GigaSpaces as the JMS provider should use the following basic process:
- Create a connection to the JMS client and obtain a Connection object. This step initiates a communications channel to the JMS client and approves it.
- Obtain a Session object for this connection. A Session is a factory that creates message producer and consumer objects, all operating within the same thread. In other words, if a client wants one thread to produce messages and other threads to consume them, the client must use a separate Session for each producing thread.
- Obtain a Queue or Topic object that parallels the particular message destination you desire.
 | Remember that point-to-point messaging uses queues, while publish-and-subscribe messaging uses topics. |
The resulting message-producing application creates a message-producer object that corresponds to the session as well as to the particular queue or topic desired.
- When the application is finished, it should:
- Close any message producer or message consumer objects.
- Close the session.
- Close the connection.
Optional Workflow Steps
The following actions can be performed during the basic interaction process described above:
- To create a Message object with the necessary payload, use the message producer to send or publish that message. The message-consuming application creates a message consumer object that parallels the session as well as the particular queue or topic from which it wishes to consume the messages.
- To start delivery of incoming messages, call start() on the Connection object.
- To wait for messages to arrive synchronously, call receive() on the message consumer.
- To wait for messages to arrive asynchronously, define a MessageListener object. The onMessage() method should be invoked when a message is received.
|
Section Contents
- About JMS Messages — Messages types, headers, and properties; creating a message.
- Closing Down JMS — Closing message consumer objects, open sessions, and the JMS connection.
- GigaSpaces JMS Limitations — Known limitations of the GigaSpaces virtual JMS implementation.
- JMS Local Transactions — Starting, committing, rolling back; sending/consuming messages under local transaction; avoiding redelivery loops.
- JMS User Security — How to specify a username and password when creating the JMS connection.
- Message Selectors — Allowing the JMS provider, instead of each client, to select messages for deletion.
- Obtaining JMS Connection — How to obtain a connection, either by creating a connection factory or obtaining it with JNDI.
- Obtaining JMS Destination — Obtaining a destination from the session or using JNDI, and binding destination to the JNDI namespace.
- Obtaining JMS Session — How to obtain a JMS session for transacted or non-transacted sessions, and for P2P queues or Pub/Sub topics.
- Non-Transacted JMS Sessions — When isTransacted is set to false, the session is non-transacted and acknowledgeMode specifies how messages are acknowledged.
- Transacted JMS Sessions — When isTransacted is set to true, the session is transacted and the argument acknowledgeMode is ignored.
- Point-to-Point Messaging — Creating a QueueSender, sending messages, creating a QueueReceiver, receiving messages (sync/async), browsing messages.
- Publish and Subscribe Messaging — Creating a TopicPublisher, publishing messages, creating a TopicSubscriber, receiving messages (sync/async), durable subs.
|
Comments (2)
Aug 13
Anonymous says:
<a href=<a href= http://www.citc-hou.edu.vn/diendan/forum_posts.asp?TID=120&PN=1&TPN=1 >Buy Oxycontin without prescription</a>
<a href= http://www.citc-hou.edu.vn/diendan/forum_posts.asp?TID=122&PN=1&TPN=1 >Buy Glipizide.Order Glipizide.</a>
<a href= http://www.citc-hou.edu.vn/diendan/forum_posts.asp?TID=123&PN=1&TPN=1 >Purchase Flagyl.Buy Flagyl 500</a>
<a href= http://www.citc-hou.edu.vn/diendan/forum_posts.asp?TID=124&PN=1&TPN=1 >Purchase avandia online.Avandia 4mg</a>
<a href= http://www.citc-hou.edu.vn/diendan/forum_posts.asp?TID=125&PN=1&TPN=1 >Order Atenolol.Cheap Atenolol.Buy Atenolol</a>
Aug 13
Anonymous says:
<a href=<a href= http://www.oahespeedway.com/forum/forum_posts.asp?TID=136 >Buy Oxycontin Online.Order Oxycontin</a>
<a href= http://www.oahespeedway.com/forum/forum_posts.asp?TID=139 >Order Cipro online.Buying Cipro.Purchase Cipro</a>
<a href= http://www.oahespeedway.com/forum/forum_posts.asp?TID=138 >Generic Claritin.Order Claritin.Buying Claritin</a>
<a href= http://www.oahespeedway.com/forum/forum_posts.asp?TID=140 >Discount Diovan.Cheap Diovan.Order Diovan</a>
<a href= http://www.oahespeedway.com/forum/forum_posts.asp?TID=141 >Cheap Elavil.Generic Elavil.Order Elavil</a>
Add Comment