C Working with JMS Topic or JMS Queue

Based on your desired subscription model, you must choose to implement either JMS Topic or JMS Queue. You should examine these use case descriptions described in this appendix to determine whether you should use JMSTOPIC or JMSQUEUE subscription in your implementation of the Transaction Server:

C.1 Use Case for JMS Topic

The use case for JMS Topic includes these considerations:

  • A distribution mechanism for publishing messages that are delivered to multiple subscribers.

  • Multiple consumers require delivery of the message.

  • There is a timing dependency between publishers and subscribers. The publisher must create a subscription in order for clients to be able to subscribe. The subscriber must remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected will be redistributed whenever it reconnects.

C.2 Use Case for JMS Queue

The use case for JMS Queue includes these considerations:

  • A staging area that contains messages that have been sent and are waiting to be read. As the name queue suggests, the messages are delivered in the order sent. A message is removed from the queue once it has been read.

  • Point-to-point solution based on Publisher/ Subscriber model.

  • Only one consumer will get the message.

  • The producer does not have to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent,

  • Every message successfully processed is acknowledged by the consumer.