javax.jms

Interface QueueSession

  • All Superinterfaces:
    AutoCloseable, Runnable, Session

    public interface QueueSession
    extends Session
    A 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
    Since:
    JMS 1.0
    Version:
    JMS 2.0
    See Also:
    Session, QueueConnection.createQueueSession(boolean, int), XAQueueSession.getQueueSession()
    • Method Detail

      • createQueue

        Queue createQueue(String queueName)
                   throws JMSException
        Creates a queue identity given a Queue name.

        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 JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

        Specified by:
        createQueue in interface Session
        Parameters:
        queueName - the name of this Queue
        Returns:
        a Queue with the given name
        Throws:
        JMSException - if the session fails to create a queue due to some internal error.
      • createReceiver

        QueueReceiver createReceiver(Queue queue)
                              throws JMSException
        Creates a QueueReceiver object to receive messages from the specified queue.
        Parameters:
        queue - the Queue to access
        Throws:
        JMSException - if the session fails to create a receiver due to some internal error.
        InvalidDestinationException - if an invalid queue is specified.
      • createReceiver

        QueueReceiver createReceiver(Queue queue,
                                     String messageSelector)
                              throws JMSException
        Creates a QueueReceiver object to receive messages from the specified queue using a message selector.
        Parameters:
        queue - the Queue to access
        messageSelector - 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.
        Throws:
        JMSException - if the session fails to create a receiver due to some internal error.
        InvalidDestinationException - if an invalid queue is specified.
        InvalidSelectorException - if the message selector is invalid.
      • createSender

        QueueSender createSender(Queue queue)
                          throws JMSException
        Creates a QueueSender object to send messages to the specified queue.
        Parameters:
        queue - the Queue to access, or null if this is an unidentified producer
        Throws:
        JMSException - if the session fails to create a sender due to some internal error.
        InvalidDestinationException - if an invalid queue is specified.
      • createBrowser

        QueueBrowser createBrowser(Queue queue,
                                   String messageSelector)
                            throws JMSException
        Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
        Specified by:
        createBrowser in interface Session
        Parameters:
        queue - the Queue to access
        messageSelector - 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.
        Throws:
        JMSException - if the session fails to create a browser due to some internal error.
        InvalidDestinationException - if an invalid queue is specified.
        InvalidSelectorException - if the message selector is invalid.
      • createTemporaryQueue

        TemporaryQueue createTemporaryQueue()
                                     throws JMSException
        Creates a TemporaryQueue object. Its lifetime will be that of the QueueConnection unless it is deleted earlier.
        Specified by:
        createTemporaryQueue in interface Session
        Returns:
        a temporary queue identity
        Throws:
        JMSException - if the session fails to create a temporary queue due to some internal error.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/jms/queuesession.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.