TopicConnection
public interface TopicConnection
extends Connection
Subinterfaces: XATopicConnection
WebSphere MQ class: MQTopicConnection
java.lang.Object | +----com.ibm.mq.jms.MQConnection | +----com.ibm.mq.jms.MQTopicConnectionA TopicConnection is an active connection to a JMS publish/subscribe provider.
See also: Connection, TopicConnectionFactory, and XATopicConnection
Methods
- createConnectionConsumer
public ConnectionConsumer createConnectionConsumer (Topic topic, java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
Create a connection consumer for this connection. This is an expert facility that is not used by regular JMS clients.
WebSphere MQ Event Broker note For a direct connection to WebSphere MQ Event Broker, this method throws a JMSException.
- Parameters:
- topic: the topic to access.
- messageSelector: only deliver messages with properties that match the message selector expression.
- sessionPool: the server session pool to associate with this connection consumer.
- maxMessages: the maximum number of messages that can be assigned to a server session at one time.
- Returns:
- The connection consumer.
- Throws:
- JMSException if the JMS Connection fails to create a connection consumer because of an internal error, or because of incorrect arguments for sessionPool.
- InvalidSelectorException if the message selector is not valid.
- See also:
- ConnectionConsumer
- createDurableConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer (Topic topic, java.lang.String subscriptionName java.lang.String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
Create a durable connection consumer for this connection. This is an expert facility that is not used by regular JMS clients.
WebSphere MQ Event Broker note For a direct connection to WebSphere MQ Event Broker, this method throws a JMSException.
- Parameters:
- topic: the topic to access.
- subscriptionName: the name of the durable subscription.
- messageSelector: deliver only messages with properties that match the message selector expression.
- sessionPool: the server session pool to associate with this durable connection consumer.
- maxMessages: the maximum number of messages that can be assigned to a server session at one time.
- Returns:
- The durable connection consumer.
- Throws:
- JMSException if the JMS Connection fails to create a connection consumer because of an internal error, or because of incorrect arguments for sessionPool and messageSelector.
- InvalidSelectorException if the message selector is not valid.
- See also:
- ConnectionConsumer
- createTopicSession
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
Create a TopicSession.
WebSphere MQ Event Broker note For a direct connection to WebSphere MQ Event Broker, if transacted is true, this method throws a JMSException.
- Parameters:
- transacted: if true, the session is transacted.
- acknowledgeMode: one of:
- Session.AUTO_ACKNOWLEDGE
- Session.CLIENT_ACKNOWLEDGE
- Session.DUPS_OK_ACKNOWLEDGE
Indicates whether the consumer or the client acknowledge any messages that they receive. This parameter is ignored if the session is transacted.
- Returns:
- A newly-created topic session.
- Throws:
- JMSException if JMS Connection fails to create a session because of an internal error, or a lack of support for the specific transaction and acknowledgement mode.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.