Package jakarta.jms

Interface TopicSession

All Superinterfaces:
AutoCloseable, Runnable, Session

public interface TopicSession extends Session
A TopicSession object provides methods for creating TopicPublisher, TopicSubscriber, and TemporaryTopic objects. It also provides a method for deleting its client's durable subscribers.

A TopicSession is used for creating Pub/Sub specific objects. In general, use the Session object, and use TopicSession only to support existing code. Using the Session object simplifies the programming model, and allows transactions to be used across the two messaging domains.

A TopicSession cannot be used to create objects specific to the point-to-point domain. The following methods inherit from Session, but must throw an IllegalStateException if used from TopicSession:

  • createBrowser
  • createQueue
  • createTemporaryQueue
Since:
JMS 1.0
Version:
Jakarta Messaging 2.0
See Also: