Class ClientSessionImpl

java.lang.Object
org.apache.activemq.artemis.core.client.impl.ClientSessionImpl
All Implemented Interfaces:
AutoCloseable, XAResource, ClientSession, ClientSessionInternal, FailureListener

public final class ClientSessionImpl extends Object implements ClientSessionInternal, FailureListener
  • Method Details

    • createQueue

      public void createQueue(SimpleString address, SimpleString 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
    • 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
    • createAddress

      public void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
      Description copied from interface: ClientSession
      Create Address with a single initial routing type
      Specified by:
      createAddress in interface ClientSession
      Throws:
      ActiveMQException
    • createAddress

      public void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
      Description copied from interface: ClientSession
      Create Address with a single initial routing type
      Specified by:
      createAddress in interface ClientSession
      Throws:
      ActiveMQException
    • createAddress

      public void createAddress(SimpleString address, RoutingType routingType, boolean autoCreated) throws ActiveMQException
      Description copied from interface: ClientSession
      Create Address with a single initial routing type
      Specified by:
      createAddress in interface ClientSession
      Throws:
      ActiveMQException
    • createQueue

      public void createQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
      Description copied from interface: ClientSession
      This method creates a queue based on the QueueConfiguration input. See QueueConfiguration for more details on configuration specifics.

      Some static defaults will be enforced for properties which are not set on the QueueConfiguration:

      Some dynamic defaults will be enforced via address-settings for the corresponding unset properties:
      • exclusive
      • groupRebalance
      • groupBuckets
      • groupFirstKey
      • lastValue
      • lastValueKey
      • nonDestructive
      • consumersBeforeDispatch
      • delayBeforeDispatch
      • ringSize
      • routingType
      • autoCreateAddress
      • autoDelete (only set if queue was auto-created)
      • autoDeleteDelay
      • autoDeleteMessageCount
      Specified by:
      createQueue in interface ClientSession
      Parameters:
      queueConfiguration - the configuration to use when creating the queue
      Throws:
      ActiveMQException
    • createSharedQueue

      public void createSharedQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
      Description copied from interface: ClientSession
      This method is essentially the same as ClientSession.createQueue(QueueConfiguration) with a few key exceptions.

      If durable is true then:

      • transient will be forced to false
      • temporary will be forced to false
      If durable is false then:
      • transient will be forced to true
      • temporary will be forced to true
      In all instances autoCreated will be forced to false and autoCreatedAddress will be forced to true.
      Specified by:
      createSharedQueue in interface ClientSession
      Throws:
      ActiveMQException
      See Also:
    • 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(SimpleString address, SimpleString 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
      queueName - the name of the queue
      Throws:
      ActiveMQException - in an exception occurs while creating the queue
    • createTemporaryQueue

      public void createTemporaryQueue(String address, 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
      queueName - the name of the queue
      Throws:
      ActiveMQException - in an exception occurs while creating the queue
    • createTemporaryQueue

      public void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString 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
    • 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.
      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
      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(SimpleString address, SimpleString queueName, boolean autoCreated, QueueAttributes queueAttributes) 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
      queueName - the name of the queue
      autoCreated - whether to mark this queue as autoCreated or not
      queueAttributes - attributes for the queue
      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(SimpleString address, RoutingType routingType, SimpleString 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

      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

      @Deprecated public void createTemporaryQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) 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
      queueName - the name of the queue
      queueAttributes - attributes for 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) 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
      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.
      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
      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
      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
      routingType - the routing type 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
      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
      routingType - the routing type 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.
      Description copied from interface: ClientSession
      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 routing type 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
    • createSharedQueue

      @Deprecated public void createSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException
      Deprecated.
      Description copied from interface: ClientSession
      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
      queueName - the name of the queue
      queueAttributes - attributes for the 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
      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
      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.
      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
      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
    • createQueue

      @Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException
      Deprecated.
      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
      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
    • createQueue

      @Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) 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
      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
      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
      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
    • deleteQueue

      public void deleteQueue(SimpleString queueName) throws ActiveMQException
      Description copied from interface: ClientSession
      Deletes the queue.
      Specified by:
      deleteQueue in interface ClientSession
      Parameters:
      queueName - the name of the queue to delete
      Throws:
      ActiveMQException - if there is no queue for the given name or if the queue has consumers
    • deleteQueue

      public void deleteQueue(String queueName) throws ActiveMQException
      Description copied from interface: ClientSession
      Deletes the queue.
      Specified by:
      deleteQueue in interface ClientSession
      Parameters:
      queueName - the name of the queue to delete
      Throws:
      ActiveMQException - if there is no queue for the given name or if the queue has consumers
    • queueQuery

      public ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
      Description copied from interface: ClientSession
      Queries information on a queue.
      Specified by:
      queueQuery in interface ClientSession
      Parameters:
      queueName - the name of the queue to query
      Returns:
      a QueueQuery containing information on the given queue
      Throws:
      ActiveMQException - if an exception occurs while querying the queue
    • addressQuery

      public ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
      Description copied from interface: ClientSession
      Queries information on a binding.
      Specified by:
      addressQuery in interface ClientSession
      Parameters:
      address - the address of the biding to query
      Returns:
      an AddressQuery containing information on the binding attached to the given address
      Throws:
      ActiveMQException - if an exception occurs while querying the binding
    • createConsumer

      public ClientConsumer createConsumer(SimpleString queueName) throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a ClientConsumer to consume message from the queue with the given name.
      Specified by:
      createConsumer in interface ClientSession
      Parameters:
      queueName - name of the queue to consume messages from
      Returns:
      a ClientConsumer
      Throws:
      ActiveMQException - if an exception occurs while creating the ClientConsumer
    • createConsumer

      public ClientConsumer createConsumer(String queueName) throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a ClientConsumer to consume messages from the queue with the given name.
      Specified by:
      createConsumer in interface ClientSession
      Parameters:
      queueName - name of the queue to consume messages from
      Returns:
      a ClientConsumer
      Throws:
      ActiveMQException - if an exception occurs while creating the ClientConsumer
    • 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
    • isWritable

      public boolean isWritable(ReadyListener callback)
      Specified by:
      isWritable in interface ClientSessionInternal
    • 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
    • createProducer

      public ClientProducer createProducer() throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a producer with no default address. Address must be specified every time a message is sent
      Specified by:
      createProducer in interface ClientSession
      Returns:
      a ClientProducer
      Throws:
      ActiveMQException
      See Also:
    • createProducer

      public ClientProducer createProducer(SimpleString address) throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a producer which sends messages to the given address
      Specified by:
      createProducer in interface ClientSession
      Parameters:
      address - the address to send messages to
      Returns:
      a ClientProducer
      Throws:
      ActiveMQException - if an exception occurs while creating the ClientProducer
    • createProducer

      public ClientProducer createProducer(String address) throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a producer which sends messages to the given address
      Specified by:
      createProducer in interface ClientSession
      Parameters:
      address - the address to send messages to
      Returns:
      a ClientProducer
      Throws:
      ActiveMQException - if an exception occurs while creating the ClientProducer
    • createProducer

      public ClientProducer createProducer(SimpleString address, int maxRate) throws ActiveMQException
      Description copied from interface: ClientSession
      Creates a producer which sends messages to the given address
      Specified by:
      createProducer in interface ClientSession
      Parameters:
      address - the address to send messages to
      maxRate - the producer rate
      Returns:
      a ClientProducer
      Throws:
      ActiveMQException - if an exception occurs while creating the ClientProducer
    • createProducer

      public ClientProducer createProducer(String address, int rate) throws ActiveMQException
      Throws:
      ActiveMQException
    • 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() throws ActiveMQException
      Description copied from interface: ClientSession
      Commits the current transaction, blocking.
      Specified by:
      commit in interface ClientSession
      Throws:
      ActiveMQException - if an exception occurs while committing the transaction
    • 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() throws ActiveMQException
      Description copied from interface: ClientSession
      Rolls back the current transaction.
      Specified by:
      rollback in interface ClientSession
      Throws:
      ActiveMQException - if an exception occurs while rolling back the transaction
    • 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
    • rollback

      public void rollback(boolean isLastMessageAsDelivered, boolean waitConsumers) throws ActiveMQException
      Throws:
      ActiveMQException
    • markRollbackOnly

      public void markRollbackOnly()
      Specified by:
      markRollbackOnly in interface ClientSessionInternal
    • 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 true if the session is closed, false else.
      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:
      whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session, false else
    • isAutoCommitAcks

      public boolean isAutoCommitAcks()
      Description copied from interface: ClientSession
      Returns true if the session 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 by a ClientConsumer created by this session, false else
    • isBlockOnAcknowledge

      public boolean isBlockOnAcknowledge()
      Description copied from interface: ClientSession
      Returns true if the session's ClientConsumer block when they acknowledge a message, false else.
      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
      Returns true if the session supports XA, false else.
      Specified by:
      isXA in interface ClientSession
      Returns:
      true if the session supports XA, false else
    • resetIfNeeded

      public void resetIfNeeded() throws ActiveMQException
      Specified by:
      resetIfNeeded in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • start

      public ClientSessionImpl start() throws ActiveMQException
      Description copied from interface: ClientSession
      Starts the session. The session must be started before ClientConsumers created by the session can consume messages from the queue.
      Specified by:
      start in interface ClientSession
      Throws:
      ActiveMQException - if an exception occurs while starting the session
    • 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
    • stop

      public void stop(boolean waitForOnMessage) throws ActiveMQException
      Throws:
      ActiveMQException
    • 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
    • isClosing

      public boolean isClosing()
      Specified by:
      isClosing in interface ClientSessionInternal
    • getNodeId

      public String getNodeId()
      Specified by:
      getNodeId in interface ClientSessionInternal
    • getMinLargeMessageSize

      public int getMinLargeMessageSize()
      Specified by:
      getMinLargeMessageSize in interface ClientSessionInternal
    • isCompressLargeMessages

      public boolean isCompressLargeMessages()
      Specified by:
      isCompressLargeMessages in interface ClientSessionInternal
    • getCompressionLevel

      public int getCompressionLevel()
      Specified by:
      getCompressionLevel in interface ClientSessionInternal
    • isCacheLargeMessageClient

      public boolean isCacheLargeMessageClient()
      Specified by:
      isCacheLargeMessageClient in interface ClientSessionInternal
    • getName

      public String getName()
      Specified by:
      getName in interface ClientSessionInternal
    • acknowledge

      public void acknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
      Specified by:
      acknowledge in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • individualAcknowledge

      public void individualAcknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
      Specified by:
      individualAcknowledge in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • expire

      public void expire(ClientConsumer consumer, Message message) throws ActiveMQException
      Specified by:
      expire in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • addConsumer

      public void addConsumer(ClientConsumerInternal consumer)
      Specified by:
      addConsumer in interface ClientSessionInternal
    • addProducer

      public void addProducer(ClientProducerInternal producer)
      Specified by:
      addProducer in interface ClientSessionInternal
    • removeConsumer

      public void removeConsumer(ClientConsumerInternal consumer) throws ActiveMQException
      Specified by:
      removeConsumer in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • removeProducer

      public void removeProducer(ClientProducerInternal producer)
      Specified by:
      removeProducer in interface ClientSessionInternal
    • handleReceiveMessage

      public void handleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message) throws Exception
      Specified by:
      handleReceiveMessage in interface ClientSessionInternal
      Throws:
      Exception
    • handleReceiveLargeMessage

      public void handleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception
      Specified by:
      handleReceiveLargeMessage in interface ClientSessionInternal
      Throws:
      Exception
    • handleReceiveContinuation

      public void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
      Specified by:
      handleReceiveContinuation in interface ClientSessionInternal
      Throws:
      Exception
    • handleConsumerDisconnect

      public void handleConsumerDisconnect(ConsumerContext context) throws ActiveMQException
      Specified by:
      handleConsumerDisconnect in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • close

      public void close() throws ActiveMQException
      Description copied from interface: ClientSession
      Closes the session.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ClientSession
      Throws:
      ActiveMQException - if an exception occurs while closing the session
    • cleanUp

      public void cleanUp(boolean failingOver) throws ActiveMQException
      Specified by:
      cleanUp in interface ClientSessionInternal
      Throws:
      ActiveMQException
    • setSendAcknowledgementHandler

      public ClientSessionImpl setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
      Description copied from interface: ClientSession
      Sets a SendAcknowledgementHandler for this session.
      Specified by:
      setSendAcknowledgementHandler in interface ClientSession
      Parameters:
      handler - a SendAcknowledgementHandler
      Returns:
      this ClientSession
    • preHandleFailover

      public void preHandleFailover(RemotingConnection connection)
      Specified by:
      preHandleFailover in interface ClientSessionInternal
    • handleFailover

      public boolean handleFailover(RemotingConnection backupConnection, ActiveMQException cause)
      Specified by:
      handleFailover in interface ClientSessionInternal
    • postHandleFailover

      public void postHandleFailover(RemotingConnection connection, boolean successful)
      Specified by:
      postHandleFailover in interface ClientSessionInternal
    • addMetaData

      public void addMetaData(String key, String data) throws ActiveMQException
      Description copied from interface: ClientSession
      Attach any metadata to the session.
      Specified by:
      addMetaData in interface ClientSession
      Throws:
      ActiveMQException
    • 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
    • getSessionFactory

      public ClientSessionFactory getSessionFactory()
      Description copied from interface: ClientSession
      Returns the ClientSessionFactory used to created this ClientSession.
      Specified by:
      getSessionFactory in interface ClientSession
      Returns:
      the ClientSessionFactory used to created this ClientSession
    • setAddress

      public void setAddress(Message message, SimpleString address)
      Description copied from interface: ClientSessionInternal
      This will set the address at the message
      Specified by:
      setAddress in interface ClientSessionInternal
    • setPacketSize

      public void setPacketSize(int packetSize)
      Specified by:
      setPacketSize in interface ClientSessionInternal
    • workDone

      public void workDone()
      Specified by:
      workDone in interface ClientSessionInternal
    • sendProducerCreditsMessage

      public void sendProducerCreditsMessage(int credits, SimpleString address)
      Specified by:
      sendProducerCreditsMessage in interface ClientSessionInternal
    • getCredits

      public ClientProducerCredits getCredits(SimpleString address, boolean anon)
      Specified by:
      getCredits in interface ClientSessionInternal
    • returnCredits

      public void returnCredits(SimpleString address)
      Specified by:
      returnCredits in interface ClientSessionInternal
    • handleReceiveProducerCredits

      public void handleReceiveProducerCredits(SimpleString address, int credits)
      Specified by:
      handleReceiveProducerCredits in interface ClientSessionInternal
    • handleReceiveProducerFailCredits

      public void handleReceiveProducerFailCredits(SimpleString address, int credits)
      Specified by:
      handleReceiveProducerFailCredits in interface ClientSessionInternal
    • getProducerCreditManager

      public ClientProducerCreditManager getProducerCreditManager()
      Specified by:
      getProducerCreditManager in interface ClientSessionInternal
    • 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
    • endCall

      public void endCall()
      Description copied from interface: ClientSessionInternal
      Specified by:
      endCall in interface ClientSessionInternal
      See Also:
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Specified by:
      commit in interface XAResource
      Throws:
      XAException
    • end

      public void end(Xid xid, int flags) throws XAException
      Specified by:
      end in interface XAResource
      Throws:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Specified by:
      forget in interface XAResource
      Throws:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout() throws XAException
      Specified by:
      getTransactionTimeout in interface XAResource
      Throws:
      XAException
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds) throws XAException
      Specified by:
      setTransactionTimeout in interface XAResource
      Throws:
      XAException
    • isSameRM

      public boolean isSameRM(XAResource xares) throws XAException
      Specified by:
      isSameRM in interface XAResource
      Throws:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException
      Specified by:
      prepare in interface XAResource
      Throws:
      XAException
    • recover

      public Xid[] recover(int flags) throws XAException
      Specified by:
      recover in interface XAResource
      Throws:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException
      Specified by:
      rollback in interface XAResource
      Throws:
      XAException
    • start

      public void start(Xid xid, int flags) throws XAException
      Specified by:
      start in interface XAResource
      Throws:
      XAException
    • 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
    • setForceNotSameRM

      public void setForceNotSameRM(boolean force)
      Specified by:
      setForceNotSameRM in interface ClientSessionInternal
    • getConnection

      public RemotingConnection getConnection()
      Specified by:
      getConnection in interface ClientSessionInternal
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • cloneProducers

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

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

      public Map<ConsumerContext,ClientConsumerInternal> cloneConsumerEntries()
    • 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

    • setStopSignal

      public void setStopSignal()
      Specified by:
      setStopSignal in interface ClientSessionInternal
    • isConfirmationWindowEnabled

      public boolean isConfirmationWindowEnabled()
      Specified by:
      isConfirmationWindowEnabled in interface ClientSessionInternal
    • getSessionContext

      public SessionContext getSessionContext()
      Specified by:
      getSessionContext in interface ClientSessionInternal
    • wrap

      Specified by:
      wrap in interface ClientSessionInternal