Class QueueConnection

  • All Implemented Interfaces:
    jakarta.jms.Connection, jakarta.jms.QueueConnection, AutoCloseable, ConnectionMBean
    Direct Known Subclasses:
    XAQueueConnection

    public class QueueConnection
    extends Connection
    implements jakarta.jms.QueueConnection
    Implements the jakarta.jms.QueueConnection interface.
    • Constructor Detail

      • QueueConnection

        public QueueConnection()
        Creates a QueueConnection instance.
    • Method Detail

      • createConnectionConsumer

        public jakarta.jms.ConnectionConsumer createConnectionConsumer​(jakarta.jms.Queue queue,
                                                                       String selector,
                                                                       jakarta.jms.ServerSessionPool sessionPool,
                                                                       int maxMessages)
                                                                throws jakarta.jms.JMSException
        API method. Creates a connection consumer for this connection, this is an expert facility needed for applications servers.
        Specified by:
        createConnectionConsumer in interface jakarta.jms.QueueConnection
        Parameters:
        queue - the queue to access.
        selector - 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 this message consumer.
        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:
        jakarta.jms.IllegalStateException - If the connection is closed.
        jakarta.jms.InvalidSelectorException - If the selector syntax is wrong.
        jakarta.jms.InvalidDestinationException - If the target destination does not exist.
        jakarta.jms.JMSException - If the method fails for any other reason.
      • createQueueSession

        public jakarta.jms.QueueSession createQueueSession​(boolean transacted,
                                                           int acknowledgeMode)
                                                    throws jakarta.jms.JMSException
        API method. Creates a QueueSession object.
        Specified by:
        createQueueSession in interface jakarta.jms.QueueConnection
        Parameters:
        transacted - indicates whether the session is transacted.
        acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
        Returns:
        A newly created session.
        Throws:
        jakarta.jms.IllegalStateException - If the connection is closed.
        jakarta.jms.JMSException - In case of an invalid acknowledge mode.
      • createDurableConnectionConsumer

        public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer​(jakarta.jms.Topic topic,
                                                                              String subname,
                                                                              String selector,
                                                                              jakarta.jms.ServerSessionPool sessPool,
                                                                              int maxMessages)
                                                                       throws jakarta.jms.JMSException
        API method.
        Specified by:
        createDurableConnectionConsumer in interface jakarta.jms.Connection
        Overrides:
        createDurableConnectionConsumer in class Connection
        Parameters:
        topic - the topic to access.
        subname - durable subscription name.
        selector - 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 this message consumer.
        sessPool - 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 durable connection consumer.
        Throws:
        jakarta.jms.IllegalStateException - Systematically.
        jakarta.jms.InvalidSelectorException - If the selector syntax is wrong.
        jakarta.jms.InvalidDestinationException - If the target topic does not exist.
        jakarta.jms.JMSException - If the method fails for any other reason.