Class ClientSessionImpl

    • Method Detail

      • createQueue

        public void createQueue​(SimpleString address,
                                SimpleString queueName,
                                boolean durable)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                String queueName,
                                boolean durable)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        public void createSharedQueue​(SimpleString address,
                                      SimpleString queueName,
                                      boolean durable)
                               throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted

        Notice: you will get an exception if the address or the filter doesn't match to an already existent queue

        Specified by:
        createSharedQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        durable - if the queue is durable
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        public void createSharedQueue​(SimpleString address,
                                      SimpleString queueName,
                                      SimpleString filterString,
                                      boolean durable)
                               throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted

        Notice: you will get an exception if the address or the filter doesn't match to an already existent queue

        Specified by:
        createSharedQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filterString - whether the queue is durable or not
        durable - if the queue is durable
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(SimpleString address,
                                SimpleString queueName,
                                SimpleString filterString,
                                boolean durable)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                String queueName,
                                String filterString,
                                boolean durable)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(SimpleString address,
                                SimpleString queueName,
                                SimpleString filterString,
                                boolean durable,
                                boolean autoCreated)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                String queueName,
                                String filterString,
                                boolean durable,
                                boolean autoCreated)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        public void createTemporaryQueue​(String address,
                                         String queueName,
                                         String filter)
                                  throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a temporary queue with a filter.
        Specified by:
        createTemporaryQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filter - only messages which match this filter will be put in the queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        public void createQueue​(SimpleString address,
                                RoutingType routingType,
                                SimpleString queueName,
                                SimpleString filterString,
                                boolean durable,
                                boolean autoCreated)
                         throws ActiveMQException
        Deprecated.
        New Queue API
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName,
                                String filterString,
                                boolean durable,
                                boolean autoCreated)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        public void createQueue​(SimpleString address,
                                RoutingType routingType,
                                SimpleString queueName,
                                SimpleString filterString,
                                boolean durable,
                                boolean autoCreated,
                                int maxConsumers,
                                boolean purgeOnNoConsumers)
                         throws ActiveMQException
        Deprecated.
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        Throws:
        ActiveMQException
      • createQueue

        @Deprecated
        public void createQueue​(SimpleString address,
                                RoutingType routingType,
                                SimpleString queueName,
                                SimpleString filterString,
                                boolean durable,
                                boolean autoCreated,
                                int maxConsumers,
                                boolean purgeOnNoConsumers,
                                Boolean exclusive,
                                Boolean lastValue)
                         throws ActiveMQException
        Deprecated.
        Description copied from interface: ClientSession
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        exclusive - whether the queue should be exclusive
        lastValue - whether the queue should be lastValue
        Throws:
        ActiveMQException
      • createQueue

        @Deprecated
        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName,
                                String filterString,
                                boolean durable,
                                boolean autoCreated,
                                int maxConsumers,
                                boolean purgeOnNoConsumers)
                         throws ActiveMQException
        Deprecated.
        Description copied from interface: ClientSession
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        Throws:
        ActiveMQException
      • createQueue

        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName,
                                String filterString,
                                boolean durable,
                                boolean autoCreated,
                                int maxConsumers,
                                boolean purgeOnNoConsumers,
                                Boolean exclusive,
                                Boolean lastValue)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filterString - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        exclusive - whether the queue should be exclusive
        lastValue - whether the queue should be lastValue
        Throws:
        ActiveMQException
      • createTemporaryQueue

        public void createTemporaryQueue​(String address,
                                         RoutingType routingType,
                                         String queueName)
                                  throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a temporary queue.
        Specified by:
        createTemporaryQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        public void createTemporaryQueue​(SimpleString address,
                                         RoutingType routingType,
                                         SimpleString queueName,
                                         SimpleString filter,
                                         int maxConsumers,
                                         boolean purgeOnNoConsumers,
                                         Boolean exclusive,
                                         Boolean lastValue)
                                  throws ActiveMQException
        Deprecated.
        Description copied from interface: ClientSession
        Creates a temporary queue with a filter.
        Specified by:
        createTemporaryQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - only messages which match this filter will be put in the queue
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        exclusive - if the queue is exclusive queue
        lastValue - if the queue is last value queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        public void createTemporaryQueue​(String address,
                                         RoutingType routingType,
                                         String queueName,
                                         String filter)
                                  throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a temporary queue with a filter.
        Specified by:
        createTemporaryQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the routing type for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - only messages which match this filter will be put in the queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        public void createQueue​(SimpleString address,
                                RoutingType routingType,
                                SimpleString queueName,
                                boolean durable)
                         throws ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        public void createSharedQueue​(SimpleString address,
                                      RoutingType routingType,
                                      SimpleString queueName,
                                      boolean durable)
                               throws ActiveMQException
        Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted

        Notice: you will get an exception if the address or the filter doesn't match to an already existent queue

        Specified by:
        createSharedQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        durable - if the queue is durable
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        public void createSharedQueue​(SimpleString address,
                                      RoutingType routingType,
                                      SimpleString queueName,
                                      SimpleString filter,
                                      boolean durable)
                               throws ActiveMQException
        Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted

        Notice: you will get an exception if the address or the filter doesn't match to an already existent queue

        Specified by:
        createSharedQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - whether the queue is durable or not
        durable - if the queue is durable
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        public void createSharedQueue​(SimpleString address,
                                      RoutingType routingType,
                                      SimpleString queueName,
                                      SimpleString filter,
                                      boolean durable,
                                      Integer maxConsumers,
                                      Boolean purgeOnNoConsumers,
                                      Boolean exclusive,
                                      Boolean lastValue)
                               throws ActiveMQException
        Deprecated.
        Creates Shared queue. A queue that will exist as long as there are consumers or is durable.
        Specified by:
        createSharedQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - whether the queue is durable or not
        durable - if the queue is durable
        maxConsumers - how many concurrent consumers will be allowed on this queue
        purgeOnNoConsumers - whether to delete the contents of the queue when the last consumer disconnects
        exclusive - if the queue is exclusive queue
        lastValue - if the queue is last value queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName,
                                boolean durable)
                         throws ActiveMQException
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName)
                         throws ActiveMQException
        Deprecated.
        Creates a non-temporary queue non-durable queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        public void createQueue​(SimpleString address,
                                RoutingType routingType,
                                SimpleString queueName,
                                SimpleString filter,
                                boolean durable)
                         throws ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        public void createQueue​(String address,
                                RoutingType routingType,
                                String queueName,
                                String filter,
                                boolean durable)
                         throws ActiveMQException
        Creates a non-temporaryqueue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        routingType - the delivery mode for this queue, MULTICAST or ANYCAST
        queueName - the name of the queue
        filter - only messages which match this filter will be put in the queue
        durable - whether the queue is durable or not
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             SimpleString filterString)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createQueue

        public void createQueue​(String address,
                                String queueName)
                         throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a non-temporary queue non-durable queue.
        Specified by:
        createQueue in interface ClientSession
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        Throws:
        ActiveMQException - in an exception occurs while creating the queue
      • createConsumer

        public ClientConsumer createConsumer​(String queueName,
                                             String filterString)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             SimpleString filterString,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             SimpleString filterString,
                                             int priority,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        priority - the consumer priority
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(String queueName,
                                             String filterString,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(String queueName,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             SimpleString filterString,
                                             int windowSize,
                                             int maxRate,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        windowSize - the consumer window size
        maxRate - the maximum rate to consume messages
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(SimpleString queueName,
                                             SimpleString filterString,
                                             int priority,
                                             int windowSize,
                                             int maxRate,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Note, we DO NOT currently support direct consumers (i.e. consumers where delivery occurs on the remoting thread).

        Direct consumers have issues with blocking and failover. E.g. if direct then inside MessageHandler call a blocking method like rollback or acknowledge (blocking) This can block until failover completes, which disallows the thread to be used to deliver any responses to the client during that period, so failover won't occur. If we want direct consumers we need to rethink how they work.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        priority - the consumer priority
        windowSize - the consumer window size
        maxRate - the maximum rate to consume messages
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        public ClientConsumer createConsumer​(String queueName,
                                             String filterString,
                                             int windowSize,
                                             int maxRate,
                                             boolean browseOnly)
                                      throws ActiveMQException
        Description copied from interface: ClientSession
        Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.

        If browseOnly is true, the ClientConsumer will receive the messages from the queue but they will not be consumed (the messages will remain in the queue). Note that paged messages will not be in the queue, and will therefore not be visible if browseOnly is true.

        If browseOnly is false, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.

        Specified by:
        createConsumer in interface ClientSession
        Parameters:
        queueName - name of the queue to consume messages from
        filterString - only messages which match this filter will be consumed
        windowSize - the consumer window size
        maxRate - the maximum rate to consume messages
        browseOnly - whether the ClientConsumer will only browse the queue or consume messages.
        Returns:
        a ClientConsumer
        Throws:
        ActiveMQException - if an exception occurs while creating the ClientConsumer
      • getXAResource

        public XAResource getXAResource()
        Description copied from interface: ClientSession
        Returns the XAResource associated to the session.
        Specified by:
        getXAResource in interface ClientSession
        Returns:
        the XAResource associated to the session
      • commit

        public void commit​(boolean block)
                    throws ActiveMQException
        Description copied from interface: ClientSession
        Commits the current transaction.
        Specified by:
        commit in interface ClientSession
        Parameters:
        block - if the commit will be blocking or not.
        Throws:
        ActiveMQException - if an exception occurs while committing the transaction
      • isRollbackOnly

        public boolean isRollbackOnly()
        Description copied from interface: ClientSession
        Returns true if the current transaction has been flagged to rollback, false else.
        Specified by:
        isRollbackOnly in interface ClientSession
        Returns:
        true if the current transaction has been flagged to rollback, false else.
      • rollback

        public void rollback​(boolean isLastMessageAsDelivered)
                      throws ActiveMQException
        Description copied from interface: ClientSession
        Rolls back the current transaction.
        Specified by:
        rollback in interface ClientSession
        Parameters:
        isLastMessageAsDelivered - the first message on deliveringMessage Buffer is considered as delivered
        Throws:
        ActiveMQException - if an exception occurs while rolling back the transaction
      • createMessage

        public ClientMessage createMessage​(byte type,
                                           boolean durable,
                                           long expiration,
                                           long timestamp,
                                           byte priority)
        Description copied from interface: ClientSession
        Creates a ClientMessage.
        Specified by:
        createMessage in interface ClientSession
        Parameters:
        type - type of the message
        durable - whether the created message is durable or not
        expiration - the message expiration
        timestamp - the message timestamp
        priority - the message priority (between 0 and 9 inclusive)
        Returns:
        a ClientMessage
      • createMessage

        public ClientMessage createMessage​(byte type,
                                           boolean durable)
        Description copied from interface: ClientSession
        Creates a ClientMessage.
        Specified by:
        createMessage in interface ClientSession
        Parameters:
        type - type of the message
        durable - whether the created message is durable or not
        Returns:
        a ClientMessage
      • createMessage

        public ClientMessage createMessage​(boolean durable)
        Description copied from interface: ClientSession
        Creates a ClientMessage.
        Specified by:
        createMessage in interface ClientSession
        Parameters:
        durable - whether the created message is durable or not
        Returns:
        a ClientMessage
      • isClosed

        public boolean isClosed()
        Description copied from interface: ClientSession
        Returns whether the session is closed or not.
        Specified by:
        isClosed in interface ClientSession
        Returns:
        true if the session is closed, false else
      • isAutoCommitSends

        public boolean isAutoCommitSends()
        Description copied from interface: ClientSession
        Returns whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session, false else
        Specified by:
        isAutoCommitSends in interface ClientSession
        Returns:
        true if the session automatically commit its transaction every time a message is sent, false else
      • isAutoCommitAcks

        public boolean isAutoCommitAcks()
        Description copied from interface: ClientSession
        Returns whether the session will automatically commit its transaction every time a message is acknowledged by a ClientConsumer created by this session, false else
        Specified by:
        isAutoCommitAcks in interface ClientSession
        Returns:
        true if the session automatically commit its transaction every time a message is acknowledged, false else
      • isBlockOnAcknowledge

        public boolean isBlockOnAcknowledge()
        Description copied from interface: ClientSession
        Returns whether the ClientConsumer created by the session will block when they acknowledge a message.
        Specified by:
        isBlockOnAcknowledge in interface ClientSession
        Returns:
        true if the session's ClientConsumer block when they acknowledge a message, false else
      • isXA

        public boolean isXA()
        Description copied from interface: ClientSession
        Return true if the session supports XA, false else.
        Specified by:
        isXA in interface ClientSession
        Returns:
        true if the session supports XA, false else.
      • stop

        public void stop()
                  throws ActiveMQException
        Description copied from interface: ClientSession
        Stops the session. ClientConsumers created by the session can not consume messages when the session is stopped.
        Specified by:
        stop in interface ClientSession
        Throws:
        ActiveMQException - if an exception occurs while stopping the session
      • addFailureListener

        public void addFailureListener​(SessionFailureListener listener)
        Description copied from interface: ClientSession
        Adds a FailureListener to the session which is notified if a failure occurs on the session.
        Specified by:
        addFailureListener in interface ClientSession
        Parameters:
        listener - the listener to add
      • removeFailureListener

        public boolean removeFailureListener​(SessionFailureListener listener)
        Description copied from interface: ClientSession
        Removes a FailureListener to the session.
        Specified by:
        removeFailureListener in interface ClientSession
        Parameters:
        listener - the listener to remove
        Returns:
        true if the listener was removed, false else
      • addFailoverListener

        public void addFailoverListener​(FailoverEventListener listener)
        Description copied from interface: ClientSession
        Adds a FailoverEventListener to the session which is notified if a failover event occurs on the session.
        Specified by:
        addFailoverListener in interface ClientSession
        Parameters:
        listener - the listener to add
      • removeFailoverListener

        public boolean removeFailoverListener​(FailoverEventListener listener)
        Description copied from interface: ClientSession
        Removes a FailoverEventListener to the session.
        Specified by:
        removeFailoverListener in interface ClientSession
        Parameters:
        listener - the listener to remove
        Returns:
        true if the listener was removed, false else
      • getVersion

        public int getVersion()
        Description copied from interface: ClientSession
        Returns the server's incrementingVersion.
        Specified by:
        getVersion in interface ClientSession
        Returns:
        the server's incrementingVersion
      • addUniqueMetaData

        public void addUniqueMetaData​(String key,
                                      String data)
                               throws ActiveMQException
        Description copied from interface: ClientSession
        Attach any metadata to the session. Throws an exception if there's already a metadata available. You can use this metadata to ensure that there is no other session with the same meta-data you are passing as an argument. This is useful to simulate unique client-ids, where you may want to avoid multiple instances of your client application connected.
        Specified by:
        addUniqueMetaData in interface ClientSession
        Throws:
        ActiveMQException
      • startCall

        public void startCall()
        Description copied from interface: ClientSessionInternal
        This is used internally to control and educate the user about using the thread boundaries properly. if more than one thread is using the session simultaneously this will generate a big warning on the docs. There are a limited number of places where we can call this such as acks and sends. otherwise we could get false warns
        Specified by:
        startCall in interface ClientSessionInternal
      • connectionFailed

        public void connectionFailed​(ActiveMQException me,
                                     boolean failedOver)
        Description copied from interface: FailureListener
        Notifies that a connection has failed due to the specified exception.
        Specified by:
        connectionFailed in interface FailureListener
        Parameters:
        me - exception which has caused the connection to fail
      • connectionFailed

        public void connectionFailed​(ActiveMQException me,
                                     boolean failedOver,
                                     String scaleDownTargetNodeID)
        Description copied from interface: FailureListener
        Notifies that a connection has failed due to the specified exception.
        Specified by:
        connectionFailed in interface FailureListener
        Parameters:
        me - exception which has caused the connection to fail
        scaleDownTargetNodeID - the ID of the node to which messages are scaling down
      • cloneProducers

        public Set<ClientProducerInternal> cloneProducers()
        Not part of the interface, used on tests only
        Returns:
      • cloneConsumers

        public Set<ClientConsumerInternal> cloneConsumers()
        Not part of the interface, used on tests only
        Returns:
      • convert

        public static Object convert​(Xid xid)
        If you ever tried to debug XIDs you will know what this is about. This will serialize and deserialize the XID to the same way it's going to be printed on server logs or print-data.

        This will convert to the same XID deserialized on the Server, hence we will be able to debug eventual stuff

        Parameters:
        xid -
        Returns: