QueueConnection object is an active connection to a
point-to-point JMS provider. A client uses a QueueConnection
object to create one or more QueueSession objects
for producing and consuming messages.
A QueueConnection can be used to create a
QueueSession, from which specialized queue-related objects
can be created.
A more general, and recommended, approach is to use the
Connection object.
The QueueConnection object
should be used to support existing code that has already used it.
A QueueConnection cannot be used to create objects
specific to the publish/subscribe domain. The
createDurableConnectionConsumer method inherits
from Connection, but must throw an
IllegalStateException
if used from QueueConnection.
javax.jms.Connection, javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory
| Modifier and Type | Method and Description |
|---|---|
| public ConnectionConsumer | Returns: the connection consumerthe queue to access queue, 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 QueueSession | Returns: a newly createdQueueSessionindicates 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(Queue queue, 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 JMS clients.
| |
| createQueueSession | back to summary |
|---|---|
| public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException Creates a
The effect of setting the In a Java SE environment or in the Java EE application client container:
In a Java EE web or EJB container, when there is an active JTA transaction in progress:
In the Java EE web or EJB container, when there is no active JTA transaction in progress:
Applications running in the Java EE web and EJB containers must not attempt
to create more than one active (not closed)
| |