TopicConnection object is an active connection to a publish/subscribe Jakarta Messaging provider. A client uses a
TopicConnection object to create one or more TopicSession objects for producing and consuming
messages.
A TopicConnection can be used to create a TopicSession, from which specialized topic-related objects
can be created. A more general, and recommended approach is to use the Connection object.
The TopicConnection object should be used to support existing code.
jakarta.jms.Connection, jakarta.jms.ConnectionFactory, jakarta.jms.TopicConnectionFactory
| Modifier and Type | Method and Description |
|---|---|
| public ConnectionConsumer | Returns: the connection consumerthe topic to access topic, String only messages with properties matching the message selector expression are delivered. A value
of null or an empty string indicates that there is no message selector for the message consumer. messageSelector, ServerSessionPool the server session pool to associate with this connection consumer sessionPool, int the maximum number of messages that can be assigned to a server session at one time maxMessages)Creates a connection consumer for this connection (optional operation). |
| public ConnectionConsumer | Returns: the durable connection consumerthe topic to access topic, String durable subscription name subscriptionName, String only messages with properties matching the message selector expression are delivered. A value
of null or an empty string indicates that there is no message selector for the message consumer. messageSelector, ServerSessionPool the server session pool to associate with this durable connection consumer sessionPool, int the maximum number of messages that can be assigned to a server session at one time maxMessages)Redeclares jakarta. |
| public TopicSession | Returns: a newly createdTopicSessionindicates whether the session will use a local transaction, except in the cases described above
when this value is ignored. transacted, int when transacted is false, indicates how messages received by the session will be acknowledged,
except in the cases described above when this value is ignored. acknowledgeMode)Creates a |
| createConnectionConsumer | back to summary |
|---|---|
| public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular Jakarta Messaging clients.
| |
| createDurableConnectionConsumer | back to summary |
|---|---|
| public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException Redeclares jakarta. Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular Jakarta Messaging clients.
| |
| createTopicSession | back to summary |
|---|---|
| public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException Creates a
The effect of setting the In a Java SE environment or in the Jakarta EE application client container:
In a Jakarta EE web or EJB container, when there is an active JTA transaction in progress:
In the Jakarta EE web or EJB container, when there is no active JTA transaction in progress:
Applications running in the Jakarta EE web and EJB containers must not attempt to create more than one active (not
closed)
| |