JMS topic resources and service integration
JMS topic resources (topics, topic spaces, connection factories, durable subscriptions) are provided by the default messaging provider for JMS publish/subscribe messaging, and supported by a service integration bus.
JMS publish/subscribe messaging and the default messaging provider is shown in the following figure:
Figure 1. JMS publish/subscribe messaging and the default messaging provider
- JMS topic
- The term "JMS topic" is used to refer to the JMS destination (an instance of javax.jms.Topic) that applications interact with, and an administrator configures as a JMS resource of the default messaging provider.
An application that uses JMS publish/subscribe messaging acts as a producer or consumer of messages with JMS topics, and has no need to know about other service integration resources that support the JMS topic.
An administrator can define a JMS topic, an administrative object that encapsulates the name of a topic and a topic space on a service integration bus. Applications can obtain the JMS topic by looking its name up in the JNDI namespace.
JMS applications can publish messages to, and subscribe to messages from, JMS topics. Subscribing applications can usually receive messages published to a topic only when the subscriber is connected to the server.
The default messaging provider also supports the use of durable subscriptions to topics, which enable the subscriber to receive messages that were published when the subscriber was disconnected. For more information about durable subscriptions, see section 6.11.1 of the JMS 1.1 specification.
- Topic space
- A topic space (a hierarchical collection of topics) is a virtual location on a service integration bus where messages are stored and processed for publish/subscribe messaging.
Unlike configuring queues, the administrator does not have to assign the topic space to a bus member. A topic space has a publication point defined automatically for each messaging engine in the bus. Messages for the topic space are stored and processed on all its publication points.
- Topic
- The term "topic" refers to a discriminator within a topic space.
When subscribing to topics, applications can specify wildcard characters to select a range of topics.
- JMS connection factory
- A "JMS connection factory" creates connections to a messaging engine that provides a publication point for the topic space.
With JMS 1.1, we are recommended to use domain-independent JMS connection factories for new applications. Domain-specific topic connection factories are supported for backwards compatibility for JMS applications developed to use domain-specific topic interfaces, as described in section 1.5 of the JMS 1.1 specification.
- Temporary JMS topics
- In addition to using JMS topics created as administrative objects, an application can also create its own temporary JMS topics, which exist at runtime only for the duration of a connection. Only that connection can create MessageConsumers for the temporary JMS topic.
For more information about creating temporary JMS destinations, see section 4.43 of the JMS 1.1 specification.
For a temporary JMS topic, the service integration bus creates a temporary topic space, which the administrator can list and browse but usually does not have to act on. A temporary topic space is deleted automatically when the connection is closed.
- Durable subscriptions
- A durable subscription on a JMS topic enables a subscriber to receive a copy of all messages published to that topic, even messages published during periods of time when the subscriber is not connected to the server. Therefore, subscriber applications can operate disconnected from the server for long periods of time, and then reconnect to the server and process messages that were published during their absence. If an application creates a durable subscription, it is added to the list that administrators can display and act on using the administrative console.
Related:
Publish/subscribe messaging and topic spaces Configure a topic connection factory for the default messaging provider Configure a topic for the default messaging provider Default messaging provider topic connection factory [Settings] (ZOS) Administrative properties for JMS connections to a bus Default messaging provider topic [Settings]