QueueSession object provides methods for creating QueueReceiver, QueueSender,
QueueBrowser, and TemporaryQueue objects.
If there are messages that have been received but not acknowledged when a QueueSession terminates, these
messages will be retained and redelivered when a consumer next accesses the queue.
A QueueSession is used for creating Point-to-Point specific objects. In general, use the Session
object. The QueueSession is used to support existing code. Using the Session object simplifies the
programming model, and allows transactions to be used across the two messaging domains.
A QueueSession cannot be used to create objects specific to the publish/subscribe domain. The following
methods inherit from Session, but must throw an IllegalStateException if they are used from
QueueSession:
createDurableSubscriber
createDurableConsumer
createSharedConsumer
createSharedDurableConsumer
createTemporaryTopic
createTopic
unsubscribe
jakarta.jms.Session, jakarta.jms.QueueConnection#createQueueSession(boolean, int), jakarta.jms.XAQueueSession#getQueueSession()
| Modifier and Type | Method and Description |
|---|---|
| public QueueBrowser | Returns: AQueueBrowser object to peek at the messages.the queue)Queue to accessRedeclares jakarta. Creates a |
| public QueueBrowser | Returns: AQueueBrowser object to peek at the messages on the specified queue.the queue, String Queue to accessonly 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)Redeclares jakarta. Creates a |
| public Queue | Returns: aQueue with the given namethe name of this queueName)QueueRedeclares jakarta. Creates a queue identity given a |
| public QueueReceiver | Returns: AQueueReceiver object to receive messages from the specified queuethe queue)Queue to accessCreates a |
| public QueueReceiver | Returns: AQueueReceiver object to receive messages from the specified queuethe queue, String Queue to accessonly 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)Creates a |
| public QueueSender | Returns: AQueueSender object to send messages to the specified queue.the queue)Queue to access, or null if this is an unidentified producerCreates a |
| public TemporaryQueue | Returns: a temporary queue identityRedeclares jakarta. Creates a |
| createBrowser | back to summary |
|---|---|
| public QueueBrowser createBrowser(Queue queue) throws JMSException Redeclares jakarta. Creates a
| |
| createBrowser | back to summary |
|---|---|
| public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException Redeclares jakarta. Creates a
| |
| createQueue | back to summary |
|---|---|
| public Queue createQueue(String queueName) throws JMSException Redeclares jakarta. Creates a queue identity given a This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.
Note that this method is not for creating the physical queue. The physical creation of queues is an administrative
task and is not to be initiated by the Jakarta Messaging API. The one exception is the creation of temporary queues, which is
accomplished with the
| |
| createReceiver | back to summary |
|---|---|
| public QueueReceiver createReceiver(Queue queue) throws JMSException Creates a
| |
| createReceiver | back to summary |
|---|---|
| public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException Creates a
| |
| createSender | back to summary |
|---|---|
| public QueueSender createSender(Queue queue) throws JMSException Creates a
| |
| createTemporaryQueue | back to summary |
|---|---|
| public TemporaryQueue createTemporaryQueue() throws JMSException Redeclares jakarta. Creates a
| |