Interface ClientSession

  • All Superinterfaces:
    AutoCloseable, XAResource
    All Known Subinterfaces:
    ClientSessionInternal
    All Known Implementing Classes:
    ClientSessionImpl

    public interface ClientSession
    extends XAResource, AutoCloseable
    A ClientSession is a single-threaded parent object required for producing and consuming messages.

    Only a single thread may be used to operate on the session and its child producers and consumers, other than close() methods which may be called from another thread. Setting a MessageHandler on a consumer renders the session, and all its child producers and consumers, to be dedicated to the session-wide handler delivery thread of control.

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addFailoverListener​(FailoverEventListener listener)
      Adds a FailoverEventListener to the session which is notified if a failover event occurs on the session.
      void addFailureListener​(SessionFailureListener listener)
      Adds a FailureListener to the session which is notified if a failure occurs on the session.
      void addMetaData​(String key, String data)
      Attach any metadata to the session.
      ClientSession.AddressQuery addressQuery​(org.apache.activemq.artemis.api.core.SimpleString address)
      Queries information on a binding.
      void addUniqueMetaData​(String key, String data)
      Attach any metadata to the session.
      void close()
      Closes the session.
      void commit()
      Commits the current transaction, blocking.
      void commit​(boolean block)
      Commits the current transaction.
      void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address, EnumSet<org.apache.activemq.artemis.api.core.RoutingType> routingTypes, boolean autoCreated)
      Create Address with a single initial routing type
      void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address, Set<org.apache.activemq.artemis.api.core.RoutingType> routingTypes, boolean autoCreated)
      Deprecated.
      void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, boolean autoCreated)
      Create Address with a single initial routing type
      ClientConsumer createConsumer​(String queueName)
      Creates a ClientConsumer to consume messages from the queue with the given name.
      ClientConsumer createConsumer​(String queueName, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages from the queue with the given name.
      ClientConsumer createConsumer​(String queueName, String filter)
      Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(String queueName, String filter, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(String queueName, String filter, int windowSize, int maxRate, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName)
      Creates a ClientConsumer to consume message from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)
      Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, int priority, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, int windowSize, int maxRate, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, int priority, int windowSize, int maxRate, boolean browseOnly)
      Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
      ClientMessage createMessage​(boolean durable)
      Creates a ClientMessage.
      ClientMessage createMessage​(byte type, boolean durable)
      Creates a ClientMessage.
      ClientMessage createMessage​(byte type, boolean durable, long expiration, long timestamp, byte priority)
      Creates a ClientMessage.
      ClientProducer createProducer()
      Creates a producer with no default address.
      ClientProducer createProducer​(String address)
      Creates a producer which sends messages to the given address
      ClientProducer createProducer​(org.apache.activemq.artemis.api.core.SimpleString address)
      Creates a producer which sends messages to the given address
      ClientProducer createProducer​(org.apache.activemq.artemis.api.core.SimpleString address, int rate)
      Creates a producer which sends messages to the given address
      void createQueue​(String address, String queueName)
      Deprecated.
      void createQueue​(String address, String queueName, boolean durable)
      Deprecated.
      void createQueue​(String address, String queueName, String filter, boolean durable)
      Deprecated.
      void createQueue​(String address, String queueName, String filter, boolean durable, boolean autoCreated)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, boolean durable)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, String filter, boolean durable)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers)
      Deprecated.
      void createQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.QueueConfiguration queueConfiguration)
      This method creates a queue based on the QueueConfiguration input.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, boolean durable)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable, boolean autoCreated)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, boolean durable)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, boolean autoCreated, org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable)
      Deprecated.
      void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable, boolean autoCreated)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.QueueConfiguration queueConfiguration)
      This method is essentially the same as createQueue(QueueConfiguration) with a few key exceptions.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, boolean durable)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, boolean durable)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
      Deprecated.
      void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, boolean durable)
      Deprecated.
      void createTemporaryQueue​(String address, String queueName)
      Deprecated.
      void createTemporaryQueue​(String address, String queueName, String filter)
      Deprecated.
      void createTemporaryQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName)
      Deprecated.
      void createTemporaryQueue​(String address, org.apache.activemq.artemis.api.core.RoutingType routingType, String queueName, String filter)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
      Deprecated.
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)
      Deprecated.
      void deleteQueue​(String queueName)
      Deletes the queue.
      void deleteQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName)
      Deletes the queue.
      ClientSessionFactory getSessionFactory()
      Return the sessionFactory used to created this Session.
      int getVersion()
      Returns the server's incrementingVersion.
      XAResource getXAResource()
      Returns the XAResource associated to the session.
      boolean isAutoCommitAcks()
      Returns whether the session will automatically commit its transaction every time a message is acknowledged by a ClientConsumer created by this session, false else
      boolean isAutoCommitSends()
      Returns whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session, false else
      boolean isBlockOnAcknowledge()
      Returns whether the ClientConsumer created by the session will block when they acknowledge a message.
      boolean isClosed()
      Returns whether the session is closed or not.
      boolean isRollbackOnly()
      Returns true if the current transaction has been flagged to rollback, false else.
      boolean isXA()
      Return true if the session supports XA, false else.
      ClientSession.QueueQuery queueQuery​(org.apache.activemq.artemis.api.core.SimpleString queueName)
      Queries information on a queue.
      boolean removeFailoverListener​(FailoverEventListener listener)
      Removes a FailoverEventListener to the session.
      boolean removeFailureListener​(SessionFailureListener listener)
      Removes a FailureListener to the session.
      void rollback()
      Rolls back the current transaction.
      void rollback​(boolean considerLastMessageAsDelivered)
      Rolls back the current transaction.
      ClientSession setSendAcknowledgementHandler​(SendAcknowledgementHandler handler)
      Sets a SendAcknowledgementHandler for this session.
      ClientSession start()
      Starts the session.
      void stop()
      Stops the session.
    • Field Detail

      • JMS_SESSION_IDENTIFIER_PROPERTY

        static final String JMS_SESSION_IDENTIFIER_PROPERTY
        This is used to identify a ClientSession as used by the JMS Layer The JMS Layer will add this through Meta-data, so the server or management layers can identify session created over core API purely or through the JMS Layer
        See Also:
        Constant Field Values
      • JMS_SESSION_CLIENT_ID_PROPERTY

        static final String JMS_SESSION_CLIENT_ID_PROPERTY
        Just like JMS_SESSION_IDENTIFIER_PROPERTY this is used to identify the ClientID over JMS Session. However this is only used when the JMS Session.clientID is set (which is optional). With this property management tools and the server can identify the jms-client-id used over JMS
        See Also:
        Constant Field Values
    • Method Detail

      • start

        ClientSession start()
                     throws org.apache.activemq.artemis.api.core.ActiveMQException
        Starts the session. The session must be started before ClientConsumers created by the session can consume messages from the queue.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while starting the session
      • stop

        void stop()
           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Stops the session. ClientConsumers created by the session can not consume messages when the session is stopped.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while stopping the session
      • close

        void close()
            throws org.apache.activemq.artemis.api.core.ActiveMQException
        Closes the session.
        Specified by:
        close in interface AutoCloseable
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while closing the session
      • isClosed

        boolean isClosed()
        Returns whether the session is closed or not.
        Returns:
        true if the session is closed, false else
      • addFailureListener

        void addFailureListener​(SessionFailureListener listener)
        Adds a FailureListener to the session which is notified if a failure occurs on the session.
        Parameters:
        listener - the listener to add
      • removeFailureListener

        boolean removeFailureListener​(SessionFailureListener listener)
        Removes a FailureListener to the session.
        Parameters:
        listener - the listener to remove
        Returns:
        true if the listener was removed, false else
      • addFailoverListener

        void addFailoverListener​(FailoverEventListener listener)
        Adds a FailoverEventListener to the session which is notified if a failover event occurs on the session.
        Parameters:
        listener - the listener to add
      • removeFailoverListener

        boolean removeFailoverListener​(FailoverEventListener listener)
        Removes a FailoverEventListener to the session.
        Parameters:
        listener - the listener to remove
        Returns:
        true if the listener was removed, false else
      • getVersion

        int getVersion()
        Returns the server's incrementingVersion.
        Returns:
        the server's incrementingVersion
      • createAddress

        void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address,
                           EnumSet<org.apache.activemq.artemis.api.core.RoutingType> routingTypes,
                           boolean autoCreated)
                    throws org.apache.activemq.artemis.api.core.ActiveMQException
        Create Address with a single initial routing type
        Parameters:
        address -
        autoCreated -
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createAddress

        @Deprecated
        void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address,
                           Set<org.apache.activemq.artemis.api.core.RoutingType> routingTypes,
                           boolean autoCreated)
                    throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Create Address with a single initial routing type
        Parameters:
        address -
        autoCreated -
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createAddress

        void createAddress​(org.apache.activemq.artemis.api.core.SimpleString address,
                           org.apache.activemq.artemis.api.core.RoutingType routingType,
                           boolean autoCreated)
                    throws org.apache.activemq.artemis.api.core.ActiveMQException
        Create Address with a single initial routing type
        Parameters:
        address -
        routingType -
        autoCreated -
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createQueue

        void createQueue​(org.apache.activemq.artemis.api.core.QueueConfiguration queueConfiguration)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        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

        Parameters:
        queueConfiguration - the configuration to use when creating the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createSharedQueue

        void createSharedQueue​(org.apache.activemq.artemis.api.core.QueueConfiguration queueConfiguration)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        This method is essentially the same as 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.

        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
        See Also:
        createQueue(QueueConfiguration)
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               boolean durable)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        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

        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        durable - if the queue is durable
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               org.apache.activemq.artemis.api.core.SimpleString filter,
                               boolean durable)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        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

        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        filter - whether the queue is durable or not
        durable - if the queue is durable
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         String queueName,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         String queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue non-durable queue.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.SimpleString queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue non-durable queue.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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
        durable - whether the queue is durable or not
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         String queueName,
                         String filter,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        durable - whether the queue is durable or not
        filter - only messages which match this filter will be put in the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable,
                         boolean autoCreated)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         String queueName,
                         String filter,
                         boolean durable,
                         boolean autoCreated)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        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
        durable - whether the queue is durable or not
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(String address,
                                  String queueName)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName,
                                  org.apache.activemq.artemis.api.core.SimpleString filter)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(String address,
                                  String queueName,
                                  String filter)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.RoutingType routingType,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               boolean durable)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        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

        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.RoutingType routingType,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               org.apache.activemq.artemis.api.core.SimpleString filter,
                               boolean durable)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        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

        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.RoutingType routingType,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               org.apache.activemq.artemis.api.core.SimpleString filter,
                               boolean durable,
                               Integer maxConsumers,
                               Boolean purgeOnNoConsumers,
                               Boolean exclusive,
                               Boolean lastValue)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates Shared queue. A queue that will exist as long as there are consumers or is durable.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createSharedQueue

        @Deprecated
        void createSharedQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                               org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates Shared queue. A queue that will exist as long as there are consumers or is durable.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        queueAttributes - attributes for the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue non-durable queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue non-durable queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName,
                         String filter,
                         boolean durable)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable,
                         boolean autoCreated)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable,
                         boolean autoCreated,
                         int maxConsumers,
                         boolean purgeOnNoConsumers)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         org.apache.activemq.artemis.api.core.SimpleString filter,
                         boolean durable,
                         boolean autoCreated,
                         int maxConsumers,
                         boolean purgeOnNoConsumers,
                         Boolean exclusive,
                         Boolean lastValue)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createQueue

        @Deprecated
        void createQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                         boolean autoCreated,
                         org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName,
                         String filter,
                         boolean durable,
                         boolean autoCreated)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        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
        autoCreated - whether to mark this queue as autoCreated or not
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName,
                         String filter,
                         boolean durable,
                         boolean autoCreated,
                         int maxConsumers,
                         boolean purgeOnNoConsumers)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        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
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createQueue

        @Deprecated
        void createQueue​(String address,
                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                         String queueName,
                         String filter,
                         boolean durable,
                         boolean autoCreated,
                         int maxConsumers,
                         boolean purgeOnNoConsumers,
                         Boolean exclusive,
                         Boolean lastValue)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a non-temporaryqueue.
        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
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.RoutingType routingType,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(String address,
                                  org.apache.activemq.artemis.api.core.RoutingType routingType,
                                  String queueName)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.RoutingType routingType,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName,
                                  org.apache.activemq.artemis.api.core.SimpleString filter,
                                  int maxConsumers,
                                  boolean purgeOnNoConsumers,
                                  Boolean exclusive,
                                  Boolean lastValue)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName,
                                  org.apache.activemq.artemis.api.core.QueueAttributes queueAttributes)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        Parameters:
        address - the queue will be bound to this address
        queueName - the name of the queue
        queueAttributes - attributes for the queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                  org.apache.activemq.artemis.api.core.RoutingType routingType,
                                  org.apache.activemq.artemis.api.core.SimpleString queueName,
                                  org.apache.activemq.artemis.api.core.SimpleString filter)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • createTemporaryQueue

        @Deprecated
        void createTemporaryQueue​(String address,
                                  org.apache.activemq.artemis.api.core.RoutingType routingType,
                                  String queueName,
                                  String filter)
                           throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deprecated.
        Creates a temporary queue with a filter.
        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - in an exception occurs while creating the queue
      • deleteQueue

        void deleteQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deletes the queue.
        Parameters:
        queueName - the name of the queue to delete
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if there is no queue for the given name or if the queue has consumers
      • deleteQueue

        void deleteQueue​(String queueName)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Deletes the queue.
        Parameters:
        queueName - the name of the queue to delete
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if there is no queue for the given name or if the queue has consumers
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a ClientConsumer to consume message from the queue with the given name.
        Parameters:
        queueName - name of the queue to consume messages from
        Returns:
        a ClientConsumer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(String queueName)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a ClientConsumer to consume messages from the queue with the given name.
        Parameters:
        queueName - name of the queue to consume messages from
        Returns:
        a ClientConsumer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      org.apache.activemq.artemis.api.core.SimpleString filter)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
        Parameters:
        queueName - name of the queue to consume messages from
        filter - only messages which match this filter will be consumed
        Returns:
        a ClientConsumer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(String queueName,
                                      String filter)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
        Parameters:
        queueName - name of the queue to consume messages from
        filter - only messages which match this filter will be consumed
        Returns:
        a ClientConsumer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(String queueName,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(String queueName,
                                      String filter,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      org.apache.activemq.artemis.api.core.SimpleString filter,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      org.apache.activemq.artemis.api.core.SimpleString filter,
                                      int priority,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      org.apache.activemq.artemis.api.core.SimpleString filter,
                                      int windowSize,
                                      int maxRate,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                      org.apache.activemq.artemis.api.core.SimpleString filter,
                                      int priority,
                                      int windowSize,
                                      int maxRate,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createConsumer

        ClientConsumer createConsumer​(String queueName,
                                      String filter,
                                      int windowSize,
                                      int maxRate,
                                      boolean browseOnly)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.

        Parameters:
        queueName - name of the queue to consume messages from
        filter - 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:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientConsumer
      • createProducer

        ClientProducer createProducer​(org.apache.activemq.artemis.api.core.SimpleString address)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a producer which sends messages to the given address
        Parameters:
        address - the address to send messages to
        Returns:
        a ClientProducer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientProducer
      • createProducer

        ClientProducer createProducer​(String address)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a producer which sends messages to the given address
        Parameters:
        address - the address to send messages to
        Returns:
        a ClientProducer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientProducer
      • createProducer

        ClientProducer createProducer​(org.apache.activemq.artemis.api.core.SimpleString address,
                                      int rate)
                               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Creates a producer which sends messages to the given address
        Parameters:
        address - the address to send messages to
        rate - the producer rate
        Returns:
        a ClientProducer
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while creating the ClientProducer
      • createMessage

        ClientMessage createMessage​(boolean durable)
        Creates a ClientMessage.
        Parameters:
        durable - whether the created message is durable or not
        Returns:
        a ClientMessage
      • createMessage

        ClientMessage createMessage​(byte type,
                                    boolean durable)
        Creates a ClientMessage.
        Parameters:
        type - type of the message
        durable - whether the created message is durable or not
        Returns:
        a ClientMessage
      • createMessage

        ClientMessage createMessage​(byte type,
                                    boolean durable,
                                    long expiration,
                                    long timestamp,
                                    byte priority)
        Creates a ClientMessage.
        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
      • queueQuery

        ClientSession.QueueQuery queueQuery​(org.apache.activemq.artemis.api.core.SimpleString queueName)
                                     throws org.apache.activemq.artemis.api.core.ActiveMQException
        Queries information on a queue.
        Parameters:
        queueName - the name of the queue to query
        Returns:
        a QueueQuery containing information on the given queue
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while querying the queue
      • addressQuery

        ClientSession.AddressQuery addressQuery​(org.apache.activemq.artemis.api.core.SimpleString address)
                                         throws org.apache.activemq.artemis.api.core.ActiveMQException
        Queries information on a binding.
        Parameters:
        address - the address of the biding to query
        Returns:
        an AddressQuery containing information on the binding attached to the given address
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while querying the binding
      • getXAResource

        XAResource getXAResource()
        Returns the XAResource associated to the session.
        Returns:
        the XAResource associated to the session
      • isXA

        boolean isXA()
        Return true if the session supports XA, false else.
        Returns:
        true if the session supports XA, false else.
      • commit

        void commit()
             throws org.apache.activemq.artemis.api.core.ActiveMQException
        Commits the current transaction, blocking.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while committing the transaction
      • commit

        void commit​(boolean block)
             throws org.apache.activemq.artemis.api.core.ActiveMQException
        Commits the current transaction.
        Parameters:
        block - if the commit will be blocking or not.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while committing the transaction
      • rollback

        void rollback()
               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Rolls back the current transaction.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while rolling back the transaction
      • rollback

        void rollback​(boolean considerLastMessageAsDelivered)
               throws org.apache.activemq.artemis.api.core.ActiveMQException
        Rolls back the current transaction.
        Parameters:
        considerLastMessageAsDelivered - the first message on deliveringMessage Buffer is considered as delivered
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException - if an exception occurs while rolling back the transaction
      • isRollbackOnly

        boolean isRollbackOnly()
        Returns true if the current transaction has been flagged to rollback, false else.
        Returns:
        true if the current transaction has been flagged to rollback, false else.
      • isAutoCommitSends

        boolean isAutoCommitSends()
        Returns whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session, false else
        Returns:
        true if the session automatically commit its transaction every time a message is sent, false else
      • isAutoCommitAcks

        boolean isAutoCommitAcks()
        Returns whether the session will automatically commit its transaction every time a message is acknowledged by a ClientConsumer created by this session, false else
        Returns:
        true if the session automatically commit its transaction every time a message is acknowledged, false else
      • isBlockOnAcknowledge

        boolean isBlockOnAcknowledge()
        Returns whether the ClientConsumer created by the session will block when they acknowledge a message.
        Returns:
        true if the session's ClientConsumer block when they acknowledge a message, false else
      • setSendAcknowledgementHandler

        ClientSession setSendAcknowledgementHandler​(SendAcknowledgementHandler handler)
        Sets a SendAcknowledgementHandler for this session.
        Parameters:
        handler - a SendAcknowledgementHandler
        Returns:
        this ClientSession
      • addMetaData

        void addMetaData​(String key,
                         String data)
                  throws org.apache.activemq.artemis.api.core.ActiveMQException
        Attach any metadata to the session.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • addUniqueMetaData

        void addUniqueMetaData​(String key,
                               String data)
                        throws org.apache.activemq.artemis.api.core.ActiveMQException
        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.
        Throws:
        org.apache.activemq.artemis.api.core.ActiveMQException
      • getSessionFactory

        ClientSessionFactory getSessionFactory()
        Return the sessionFactory used to created this Session.
        Returns: