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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.api.core.client.ClientSession
ClientSession.AddressQuery, ClientSession.QueueQuery
-
-
Field Summary
-
Fields inherited from interface org.apache.activemq.artemis.api.core.client.ClientSession
JMS_SESSION_CLIENT_ID_PROPERTY, JMS_SESSION_IDENTIFIER_PROPERTY
-
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidacknowledge(ClientConsumer consumer, Message message)Acknowledges all messages received by the consumer so far.voidaddConsumer(ClientConsumerInternal consumer)voidaddFailoverListener(FailoverEventListener listener)Adds a FailoverEventListener to the session which is notified if a failover event occurs on the session.voidaddFailureListener(SessionFailureListener listener)Adds a FailureListener to the session which is notified if a failure occurs on the session.voidaddMetaData(String key, String data)Attach any metadata to the session.voidaddProducer(ClientProducerInternal producer)ClientSession.AddressQueryaddressQuery(SimpleString address)Queries information on a binding.voidaddUniqueMetaData(String key, String data)Attach any metadata to the session.voidcleanUp(boolean failingOver)Map<ConsumerContext,ClientConsumerInternal>cloneConsumerEntries()Set<ClientConsumerInternal>cloneConsumers()Not part of the interface, used on tests onlySet<ClientProducerInternal>cloneProducers()Not part of the interface, used on tests onlyvoidclose()Closes the session.voidcommit()Commits the current transaction, blocking.voidcommit(boolean block)Commits the current transaction.voidcommit(Xid xid, boolean onePhase)voidconnectionFailed(ActiveMQException me, boolean failedOver)Notifies that a connection has failed due to the specified exception.voidconnectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)Notifies that a connection has failed due to the specified exception.static Objectconvert(Xid xid)If you ever tried to debug XIDs you will know what this is about.voidcreateAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated)Create Address with a single initial routing typevoidcreateAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated)Create Address with a single initial routing typevoidcreateAddress(SimpleString address, RoutingType routingType, boolean autoCreated)Create Address with a single initial routing typeClientConsumercreateConsumer(String queueName)Creates a ClientConsumer to consume messages from the queue with the given name.ClientConsumercreateConsumer(String queueName, boolean browseOnly)Creates a ClientConsumer to consume or browse messages from the queue with the given name.ClientConsumercreateConsumer(String queueName, String filterString)Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(String queueName, String filterString, boolean browseOnly)Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(String queueName, String filterString, int windowSize, int maxRate, boolean browseOnly)Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName)Creates a ClientConsumer to consume message from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, boolean browseOnly)Creates a ClientConsumer to consume or browse messages from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, SimpleString filterString)Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, SimpleString filterString, boolean browseOnly)Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, SimpleString filterString, int priority, boolean browseOnly)Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, boolean browseOnly)Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.ClientConsumercreateConsumer(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, boolean browseOnly)Note, we DO NOT currently support direct consumers (i.e.ClientMessagecreateMessage(boolean durable)Creates a ClientMessage.ClientMessagecreateMessage(byte type, boolean durable)Creates a ClientMessage.ClientMessagecreateMessage(byte type, boolean durable, long expiration, long timestamp, byte priority)Creates a ClientMessage.ClientProducercreateProducer()Creates a producer with no default address.ClientProducercreateProducer(String address)Creates a producer which sends messages to the given addressClientProducercreateProducer(String address, int rate)ClientProducercreateProducer(SimpleString address)Creates a producer which sends messages to the given addressClientProducercreateProducer(SimpleString address, int maxRate)Creates a producer which sends messages to the given addressvoidcreateQueue(String address, String queueName)Creates a non-temporary queue non-durable queue.voidcreateQueue(String address, String queueName, boolean durable)Creates a non-temporary queue.voidcreateQueue(String address, String queueName, String filterString, boolean durable)Creates a non-temporaryqueue.voidcreateQueue(String address, String queueName, String filterString, boolean durable, boolean autoCreated)Creates a non-temporaryqueue.voidcreateQueue(String address, RoutingType routingType, String queueName)Deprecated.voidcreateQueue(String address, RoutingType routingType, String queueName, boolean durable)Creates a non-temporary queue.voidcreateQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable)Creates a non-temporaryqueue.voidcreateQueue(String address, RoutingType routingType, String queueName, String filterString, boolean durable, boolean autoCreated)Creates a non-temporaryqueue.voidcreateQueue(String address, RoutingType routingType, String queueName, String filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers)Deprecated.voidcreateQueue(String address, RoutingType routingType, String queueName, String filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)Creates a non-temporaryqueue.voidcreateQueue(QueueConfiguration queueConfiguration)This method creates a queue based on theQueueConfigurationinput.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName)Deprecated.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable)Deprecated.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable)Deprecated.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated)Deprecated.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers)Deprecated.voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)Deprecated.voidcreateQueue(SimpleString address, SimpleString queueName)Creates a non-temporary queue non-durable queue.voidcreateQueue(SimpleString address, SimpleString queueName, boolean durable)Creates a non-temporary queue.voidcreateQueue(SimpleString address, SimpleString queueName, boolean autoCreated, QueueAttributes queueAttributes)Deprecated.voidcreateQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable)Creates a non-temporary queue.voidcreateQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated)Creates a non-temporary queue.voidcreateSharedQueue(QueueConfiguration queueConfiguration)This method is essentially the same asClientSession.createQueue(QueueConfiguration)with a few key exceptions.voidcreateSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable)Creates a transient queue.voidcreateSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable)Creates a transient queue.voidcreateSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)Deprecated.voidcreateSharedQueue(SimpleString address, SimpleString queueName, boolean durable)Creates a transient queue.voidcreateSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes)Deprecated.voidcreateSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable)Creates a transient queue.voidcreateTemporaryQueue(String address, String queueName)Creates a temporary queue.voidcreateTemporaryQueue(String address, String queueName, String filter)Creates a temporary queue with a filter.voidcreateTemporaryQueue(String address, RoutingType routingType, String queueName)Creates a temporary queue.voidcreateTemporaryQueue(String address, RoutingType routingType, String queueName, String filter)Creates a temporary queue with a filter.voidcreateTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName)Creates a temporary queue.voidcreateTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter)Deprecated.voidcreateTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue)Deprecated.voidcreateTemporaryQueue(SimpleString address, SimpleString queueName)Creates a temporary queue.voidcreateTemporaryQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes)Deprecated.voidcreateTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter)Creates a temporary queue with a filter.voiddeleteQueue(String queueName)Deletes the queue.voiddeleteQueue(SimpleString queueName)Deletes the queue.voidend(Xid xid, int flags)voidendCall()voidexpire(ClientConsumer consumer, Message message)voidforget(Xid xid)RemotingConnectiongetConnection()ClientProducerCreditsgetCredits(SimpleString address, boolean anon)intgetMinLargeMessageSize()StringgetName()StringgetNodeId()ClientProducerCreditManagergetProducerCreditManager()SessionContextgetSessionContext()ClientSessionFactorygetSessionFactory()Return the sessionFactory used to created this Session.intgetTransactionTimeout()intgetVersion()Returns the server's incrementingVersion.XAResourcegetXAResource()Returns the XAResource associated to the session.voidhandleConsumerDisconnect(ConsumerContext context)booleanhandleFailover(RemotingConnection backupConnection, ActiveMQException cause)voidhandleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues)voidhandleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize)voidhandleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message)voidhandleReceiveProducerCredits(SimpleString address, int credits)voidhandleReceiveProducerFailCredits(SimpleString address, int credits)voidindividualAcknowledge(ClientConsumer consumer, Message message)booleanisAutoCommitAcks()Returns whether the session will automatically commit its transaction every time a message is acknowledged by a ClientConsumer created by this session,falseelsebooleanisAutoCommitSends()Returns whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session,falseelsebooleanisBlockOnAcknowledge()Returns whether the ClientConsumer created by the session will block when they acknowledge a message.booleanisCacheLargeMessageClient()booleanisClosed()Returns whether the session is closed or not.booleanisClosing()booleanisCompressLargeMessages()booleanisConfirmationWindowEnabled()booleanisRollbackOnly()Returnstrueif the current transaction has been flagged to rollback,falseelse.booleanisSameRM(XAResource xares)booleanisWritable(ReadyListener callback)booleanisXA()Returntrueif the session supports XA,falseelse.voidmarkRollbackOnly()voidpostHandleFailover(RemotingConnection connection, boolean successful)voidpreHandleFailover(RemotingConnection connection)intprepare(Xid xid)ClientSession.QueueQueryqueueQuery(SimpleString queueName)Queries information on a queue.Xid[]recover(int flags)voidremoveConsumer(ClientConsumerInternal consumer)booleanremoveFailoverListener(FailoverEventListener listener)Removes a FailoverEventListener to the session.booleanremoveFailureListener(SessionFailureListener listener)Removes a FailureListener to the session.voidremoveProducer(ClientProducerInternal producer)voidresetIfNeeded()voidreturnCredits(SimpleString address)voidrollback()Rolls back the current transaction.voidrollback(boolean isLastMessageAsDelivered)Rolls back the current transaction.voidrollback(boolean isLastMessageAsDelivered, boolean waitConsumers)voidrollback(Xid xid)voidscheduleConfirmation(SendAcknowledgementHandler handler, Message message)voidsendProducerCreditsMessage(int credits, SimpleString address)voidsetAddress(Message message, SimpleString address)This will set the address at the messagevoidsetForceNotSameRM(boolean force)voidsetPacketSize(int packetSize)ClientSessionImplsetSendAcknowledgementHandler(SendAcknowledgementHandler handler)Sets aSendAcknowledgementHandlerfor this session.voidsetStopSignal()Sets a stop signal to true.booleansetTransactionTimeout(int seconds)ClientSessionImplstart()Starts the session.voidstart(Xid xid, int flags)voidstartCall()This is used internally to control and educate the user about using the thread boundaries properly.voidstop()Stops the session.voidstop(boolean waitForOnMessage)StringtoString()voidworkDone()
-
-
-
Method Detail
-
createQueue
public void createQueue(SimpleString address, SimpleString queueName) throws ActiveMQException
Description copied from interface:ClientSessionCreates a non-temporary queue non-durable queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuedurable- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuedurable- 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:ClientSessionCreates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deletedNotice: you will get an exception if the address or the filter doesn't match to an already existent queue
- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuedurable- 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:ClientSessionCreates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deletedNotice: you will get an exception if the address or the filter doesn't match to an already existent queue
- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilterString- whether the queue is durable or notdurable- 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:ClientSessionCreate Address with a single initial routing type- Specified by:
createAddressin interfaceClientSession- Throws:
ActiveMQException
-
createAddress
public void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
Description copied from interface:ClientSessionCreate Address with a single initial routing type- Specified by:
createAddressin interfaceClientSession- Throws:
ActiveMQException
-
createAddress
public void createAddress(SimpleString address, RoutingType routingType, boolean autoCreated) throws ActiveMQException
Description copied from interface:ClientSessionCreate Address with a single initial routing type- Specified by:
createAddressin interfaceClientSession- Throws:
ActiveMQException
-
createQueue
public void createQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
Description copied from interface:ClientSessionThis method creates a queue based on theQueueConfigurationinput. SeeQueueConfigurationfor more details on configuration specifics.Some static defaults will be enforced for properties which are not set on the
QueueConfiguration:transient:falsetemporary:falsedurable:trueautoCreated:falseinternal:falseconfigurationManaged:falsemaxConsumers:ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()purgeOnNoConsumers:ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers()
Some dynamic defaults will be enforced via address-settings for the corresponding unset properties:
exclusivegroupRebalancegroupBucketsgroupFirstKeylastValuelastValueKeynonDestructiveconsumersBeforeDispatchdelayBeforeDispatchringSizeroutingTypeautoCreateAddressautoDelete(only set if queue was auto-created)autoDeleteDelayautoDeleteMessageCount
- Specified by:
createQueuein interfaceClientSession- Parameters:
queueConfiguration- the configuration to use when creating the queue- Throws:
ActiveMQException
-
createSharedQueue
public void createSharedQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
Description copied from interface:ClientSessionThis method is essentially the same asClientSession.createQueue(QueueConfiguration)with a few key exceptions.If
durableistruethen:transientwill be forced tofalsetemporarywill be forced tofalse
If
durableisfalsethen:transientwill be forced totruetemporarywill be forced totrue
In all instances
autoCreatedwill be forced tofalseandautoCreatedAddresswill be forced totrue.- Specified by:
createSharedQueuein interfaceClientSession- Throws:
ActiveMQException- See Also:
ClientSession.createQueue(QueueConfiguration)
-
createQueue
public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
Description copied from interface:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- 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:ClientSessionCreates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- 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:ClientSessionCreates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- 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:ClientSessionCreates a temporary queue.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- 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:ClientSessionCreates a temporary queue.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilter- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuefilter- only messages which match this filter will be put in the queue- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createQueue
@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated) throws ActiveMQException
Deprecated.New Queue API- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- 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:ClientSessionCreates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- whether to mark this queue as autoCreated or notmaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- whether to mark this queue as autoCreated or notmaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- whether to delete the contents of the queue when the last consumer disconnectsexclusive- whether the queue should be exclusivelastValue- 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:ClientSessionCreates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queueautoCreated- whether to mark this queue as autoCreated or notqueueAttributes- 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:ClientSessionCreates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- whether to mark this queue as autoCreated or notmaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- 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:ClientSessionCreates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilterString- only messages which match this filter will be put in the queuedurable- whether the queue is durable or notautoCreated- whether to mark this queue as autoCreated or notmaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- whether to delete the contents of the queue when the last consumer disconnectsexclusive- whether the queue should be exclusivelastValue- whether the queue should be lastValue- Throws:
ActiveMQException
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException
Description copied from interface:ClientSessionCreates a temporary queue.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- 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:ClientSessionCreates a temporary queue.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- only messages which match this filter will be put in the queuemaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- whether to delete the contents of the queue when the last consumer disconnectsexclusive- if the queue is exclusive queuelastValue- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuequeueAttributes- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- 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:ClientSessionCreates a temporary queue with a filter.- Specified by:
createTemporaryQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the routing type for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- only messages which match this filter will be put in the queue- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createQueue
@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException
Deprecated.Creates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuedurable- whether the queue is durable or not- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createSharedQueue
public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException
Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deletedNotice: you will get an exception if the address or the filter doesn't match to an already existent queue
- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuedurable- if the queue is durable- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createSharedQueue
public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException
Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deletedNotice: you will get an exception if the address or the filter doesn't match to an already existent queue
- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- whether the queue is durable or notdurable- if the queue is durable- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createSharedQueue
@Deprecated public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
Deprecated.Creates Shared queue. A queue that will exist as long as there are consumers or is durable.- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- whether the queue is durable or notdurable- if the queue is durablemaxConsumers- how many concurrent consumers will be allowed on this queuepurgeOnNoConsumers- whether to delete the contents of the queue when the last consumer disconnectsexclusive- if the queue is exclusive queuelastValue- 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.Creates Shared queue. A queue that will exist as long as there are consumers or is durable.- Specified by:
createSharedQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- the name of the queuequeueAttributes- 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
Creates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuedurable- whether the queue is durable or not- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createQueue
@Deprecated public void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException
Deprecated.Creates a non-temporary queue non-durable queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- 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.Creates a non-temporary queue non-durable queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queue- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createQueue
@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException
Deprecated.Creates a non-temporary queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- only messages which match this filter will be put in the queuedurable- whether the queue is durable or not- Throws:
ActiveMQException- in an exception occurs while creating the queue
-
createQueue
public void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException
Creates a non-temporaryqueue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressroutingType- the delivery mode for this queue, MULTICAST or ANYCASTqueueName- the name of the queuefilter- only messages which match this filter will be put in the queuedurable- 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:ClientSessionDeletes the queue.- Specified by:
deleteQueuein interfaceClientSession- 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:ClientSessionDeletes the queue.- Specified by:
deleteQueuein interfaceClientSession- 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:ClientSessionQueries information on a queue.- Specified by:
queueQueryin interfaceClientSession- 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:ClientSessionQueries information on a binding.- Specified by:
addressQueryin interfaceClientSession- 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:ClientSessionCreates a ClientConsumer to consume message from the queue with the given name.- Specified by:
createConsumerin interfaceClientSession- 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:ClientSessionCreates a ClientConsumer to consume messages from the queue with the given name.- Specified by:
createConsumerin interfaceClientSession- 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:ClientSessionCreates a ClientConsumer to consume messages matching the filter from the queue with the given name.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- 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:ClientSessionCreates a non-temporary queue non-durable queue.- Specified by:
createQueuein interfaceClientSession- Parameters:
address- the queue will be bound to this addressqueueName- 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:ClientSessionCreates a ClientConsumer to consume messages matching the filter from the queue with the given name.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- 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:ClientSessionCreates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedbrowseOnly- 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:ClientSessionCreates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedpriority- the consumer prioritybrowseOnly- 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:ClientSessionCreates a ClientConsumer to consume or browse messages from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages frombrowseOnly- 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:ClientSessionCreates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedbrowseOnly- 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:ClientSessionCreates a ClientConsumer to consume or browse messages from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages frombrowseOnly- 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:
isWritablein interfaceClientSessionInternal
-
createConsumer
public ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException
Description copied from interface:ClientSessionCreates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedwindowSize- the consumer window sizemaxRate- the maximum rate to consume messagesbrowseOnly- 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:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedpriority- the consumer prioritywindowSize- the consumer window sizemaxRate- the maximum rate to consume messagesbrowseOnly- 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:ClientSessionCreates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.If
browseOnlyistrue, 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 ifbrowseOnlyistrue.If
browseOnlyisfalse, the ClientConsumer will behave like consume the messages from the queue and the messages will effectively be removed from the queue.- Specified by:
createConsumerin interfaceClientSession- Parameters:
queueName- name of the queue to consume messages fromfilterString- only messages which match this filter will be consumedwindowSize- the consumer window sizemaxRate- the maximum rate to consume messagesbrowseOnly- 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:ClientSessionCreates a producer with no default address. Address must be specified every time a message is sent- Specified by:
createProducerin interfaceClientSession- Returns:
- a ClientProducer
- Throws:
ActiveMQException- See Also:
ClientProducer.send(SimpleString, org.apache.activemq.artemis.api.core.Message)
-
createProducer
public ClientProducer createProducer(SimpleString address) throws ActiveMQException
Description copied from interface:ClientSessionCreates a producer which sends messages to the given address- Specified by:
createProducerin interfaceClientSession- 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:ClientSessionCreates a producer which sends messages to the given address- Specified by:
createProducerin interfaceClientSession- 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:ClientSessionCreates a producer which sends messages to the given address- Specified by:
createProducerin interfaceClientSession- Parameters:
address- the address to send messages tomaxRate- 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:ClientSessionReturns the XAResource associated to the session.- Specified by:
getXAResourcein interfaceClientSession- Returns:
- the XAResource associated to the session
-
commit
public void commit() throws ActiveMQExceptionDescription copied from interface:ClientSessionCommits the current transaction, blocking.- Specified by:
commitin interfaceClientSession- Throws:
ActiveMQException- if an exception occurs while committing the transaction
-
commit
public void commit(boolean block) throws ActiveMQExceptionDescription copied from interface:ClientSessionCommits the current transaction.- Specified by:
commitin interfaceClientSession- 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:ClientSessionReturnstrueif the current transaction has been flagged to rollback,falseelse.- Specified by:
isRollbackOnlyin interfaceClientSession- Returns:
trueif the current transaction has been flagged to rollback,falseelse.
-
rollback
public void rollback() throws ActiveMQExceptionDescription copied from interface:ClientSessionRolls back the current transaction.- Specified by:
rollbackin interfaceClientSession- Throws:
ActiveMQException- if an exception occurs while rolling back the transaction
-
rollback
public void rollback(boolean isLastMessageAsDelivered) throws ActiveMQExceptionDescription copied from interface:ClientSessionRolls back the current transaction.- Specified by:
rollbackin interfaceClientSession- 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:
markRollbackOnlyin interfaceClientSessionInternal
-
createMessage
public ClientMessage createMessage(byte type, boolean durable, long expiration, long timestamp, byte priority)
Description copied from interface:ClientSessionCreates a ClientMessage.- Specified by:
createMessagein interfaceClientSession- Parameters:
type- type of the messagedurable- whether the created message is durable or notexpiration- the message expirationtimestamp- the message timestamppriority- the message priority (between 0 and 9 inclusive)- Returns:
- a ClientMessage
-
createMessage
public ClientMessage createMessage(byte type, boolean durable)
Description copied from interface:ClientSessionCreates a ClientMessage.- Specified by:
createMessagein interfaceClientSession- Parameters:
type- type of the messagedurable- whether the created message is durable or not- Returns:
- a ClientMessage
-
createMessage
public ClientMessage createMessage(boolean durable)
Description copied from interface:ClientSessionCreates a ClientMessage.- Specified by:
createMessagein interfaceClientSession- Parameters:
durable- whether the created message is durable or not- Returns:
- a ClientMessage
-
isClosed
public boolean isClosed()
Description copied from interface:ClientSessionReturns whether the session is closed or not.- Specified by:
isClosedin interfaceClientSession- Returns:
trueif the session is closed,falseelse
-
isAutoCommitSends
public boolean isAutoCommitSends()
Description copied from interface:ClientSessionReturns whether the session will automatically commit its transaction every time a message is sent by a ClientProducer created by this session,falseelse- Specified by:
isAutoCommitSendsin interfaceClientSession- Returns:
trueif the session automatically commit its transaction every time a message is sent,falseelse
-
isAutoCommitAcks
public boolean isAutoCommitAcks()
Description copied from interface:ClientSessionReturns whether the session will automatically commit its transaction every time a message is acknowledged by a ClientConsumer created by this session,falseelse- Specified by:
isAutoCommitAcksin interfaceClientSession- Returns:
trueif the session automatically commit its transaction every time a message is acknowledged,falseelse
-
isBlockOnAcknowledge
public boolean isBlockOnAcknowledge()
Description copied from interface:ClientSessionReturns whether the ClientConsumer created by the session will block when they acknowledge a message.- Specified by:
isBlockOnAcknowledgein interfaceClientSession- Returns:
trueif the session's ClientConsumer block when they acknowledge a message,falseelse
-
isXA
public boolean isXA()
Description copied from interface:ClientSessionReturntrueif the session supports XA,falseelse.- Specified by:
isXAin interfaceClientSession- Returns:
trueif the session supports XA,falseelse.
-
resetIfNeeded
public void resetIfNeeded() throws ActiveMQException- Specified by:
resetIfNeededin interfaceClientSessionInternal- Throws:
ActiveMQException
-
start
public ClientSessionImpl start() throws ActiveMQException
Description copied from interface:ClientSessionStarts the session. The session must be started before ClientConsumers created by the session can consume messages from the queue.- Specified by:
startin interfaceClientSession- Throws:
ActiveMQException- if an exception occurs while starting the session
-
stop
public void stop() throws ActiveMQExceptionDescription copied from interface:ClientSessionStops the session. ClientConsumers created by the session can not consume messages when the session is stopped.- Specified by:
stopin interfaceClientSession- 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:ClientSessionAdds a FailureListener to the session which is notified if a failure occurs on the session.- Specified by:
addFailureListenerin interfaceClientSession- Parameters:
listener- the listener to add
-
removeFailureListener
public boolean removeFailureListener(SessionFailureListener listener)
Description copied from interface:ClientSessionRemoves a FailureListener to the session.- Specified by:
removeFailureListenerin interfaceClientSession- Parameters:
listener- the listener to remove- Returns:
trueif the listener was removed,falseelse
-
addFailoverListener
public void addFailoverListener(FailoverEventListener listener)
Description copied from interface:ClientSessionAdds a FailoverEventListener to the session which is notified if a failover event occurs on the session.- Specified by:
addFailoverListenerin interfaceClientSession- Parameters:
listener- the listener to add
-
removeFailoverListener
public boolean removeFailoverListener(FailoverEventListener listener)
Description copied from interface:ClientSessionRemoves a FailoverEventListener to the session.- Specified by:
removeFailoverListenerin interfaceClientSession- Parameters:
listener- the listener to remove- Returns:
trueif the listener was removed,falseelse
-
getVersion
public int getVersion()
Description copied from interface:ClientSessionReturns the server's incrementingVersion.- Specified by:
getVersionin interfaceClientSession- Returns:
- the server's
incrementingVersion
-
isClosing
public boolean isClosing()
- Specified by:
isClosingin interfaceClientSessionInternal
-
getNodeId
public String getNodeId()
- Specified by:
getNodeIdin interfaceClientSessionInternal
-
getMinLargeMessageSize
public int getMinLargeMessageSize()
- Specified by:
getMinLargeMessageSizein interfaceClientSessionInternal
-
isCompressLargeMessages
public boolean isCompressLargeMessages()
- Specified by:
isCompressLargeMessagesin interfaceClientSessionInternal
-
isCacheLargeMessageClient
public boolean isCacheLargeMessageClient()
- Specified by:
isCacheLargeMessageClientin interfaceClientSessionInternal- Returns:
- the cacheLargeMessageClient
-
getName
public String getName()
- Specified by:
getNamein interfaceClientSessionInternal
-
acknowledge
public void acknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
Acknowledges all messages received by the consumer so far.- Specified by:
acknowledgein interfaceClientSessionInternal- Throws:
ActiveMQException
-
individualAcknowledge
public void individualAcknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
- Specified by:
individualAcknowledgein interfaceClientSessionInternal- Throws:
ActiveMQException
-
expire
public void expire(ClientConsumer consumer, Message message) throws ActiveMQException
- Specified by:
expirein interfaceClientSessionInternal- Throws:
ActiveMQException
-
addConsumer
public void addConsumer(ClientConsumerInternal consumer)
- Specified by:
addConsumerin interfaceClientSessionInternal
-
addProducer
public void addProducer(ClientProducerInternal producer)
- Specified by:
addProducerin interfaceClientSessionInternal
-
removeConsumer
public void removeConsumer(ClientConsumerInternal consumer) throws ActiveMQException
- Specified by:
removeConsumerin interfaceClientSessionInternal- Throws:
ActiveMQException
-
removeProducer
public void removeProducer(ClientProducerInternal producer)
- Specified by:
removeProducerin interfaceClientSessionInternal
-
handleReceiveMessage
public void handleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message) throws Exception
- Specified by:
handleReceiveMessagein interfaceClientSessionInternal- Throws:
Exception
-
handleReceiveLargeMessage
public void handleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception
- Specified by:
handleReceiveLargeMessagein interfaceClientSessionInternal- Throws:
Exception
-
handleReceiveContinuation
public void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
- Specified by:
handleReceiveContinuationin interfaceClientSessionInternal- Throws:
Exception
-
handleConsumerDisconnect
public void handleConsumerDisconnect(ConsumerContext context) throws ActiveMQException
- Specified by:
handleConsumerDisconnectin interfaceClientSessionInternal- Throws:
ActiveMQException
-
close
public void close() throws ActiveMQExceptionDescription copied from interface:ClientSessionCloses the session.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceClientSession- Throws:
ActiveMQException- if an exception occurs while closing the session
-
cleanUp
public void cleanUp(boolean failingOver) throws ActiveMQException- Specified by:
cleanUpin interfaceClientSessionInternal- Throws:
ActiveMQException
-
setSendAcknowledgementHandler
public ClientSessionImpl setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
Description copied from interface:ClientSessionSets aSendAcknowledgementHandlerfor this session.- Specified by:
setSendAcknowledgementHandlerin interfaceClientSession- Parameters:
handler- a SendAcknowledgementHandler- Returns:
- this ClientSession
-
preHandleFailover
public void preHandleFailover(RemotingConnection connection)
- Specified by:
preHandleFailoverin interfaceClientSessionInternal
-
handleFailover
public boolean handleFailover(RemotingConnection backupConnection, ActiveMQException cause)
- Specified by:
handleFailoverin interfaceClientSessionInternal
-
postHandleFailover
public void postHandleFailover(RemotingConnection connection, boolean successful)
- Specified by:
postHandleFailoverin interfaceClientSessionInternal
-
addMetaData
public void addMetaData(String key, String data) throws ActiveMQException
Description copied from interface:ClientSessionAttach any metadata to the session.- Specified by:
addMetaDatain interfaceClientSession- Throws:
ActiveMQException
-
addUniqueMetaData
public void addUniqueMetaData(String key, String data) throws ActiveMQException
Description copied from interface:ClientSessionAttach 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:
addUniqueMetaDatain interfaceClientSession- Throws:
ActiveMQException
-
getSessionFactory
public ClientSessionFactory getSessionFactory()
Description copied from interface:ClientSessionReturn the sessionFactory used to created this Session.- Specified by:
getSessionFactoryin interfaceClientSession- Returns:
-
setAddress
public void setAddress(Message message, SimpleString address)
Description copied from interface:ClientSessionInternalThis will set the address at the message- Specified by:
setAddressin interfaceClientSessionInternal
-
setPacketSize
public void setPacketSize(int packetSize)
- Specified by:
setPacketSizein interfaceClientSessionInternal
-
workDone
public void workDone()
- Specified by:
workDonein interfaceClientSessionInternal
-
sendProducerCreditsMessage
public void sendProducerCreditsMessage(int credits, SimpleString address)- Specified by:
sendProducerCreditsMessagein interfaceClientSessionInternal
-
getCredits
public ClientProducerCredits getCredits(SimpleString address, boolean anon)
- Specified by:
getCreditsin interfaceClientSessionInternal
-
returnCredits
public void returnCredits(SimpleString address)
- Specified by:
returnCreditsin interfaceClientSessionInternal
-
handleReceiveProducerCredits
public void handleReceiveProducerCredits(SimpleString address, int credits)
- Specified by:
handleReceiveProducerCreditsin interfaceClientSessionInternal
-
handleReceiveProducerFailCredits
public void handleReceiveProducerFailCredits(SimpleString address, int credits)
- Specified by:
handleReceiveProducerFailCreditsin interfaceClientSessionInternal
-
getProducerCreditManager
public ClientProducerCreditManager getProducerCreditManager()
- Specified by:
getProducerCreditManagerin interfaceClientSessionInternal
-
startCall
public void startCall()
Description copied from interface:ClientSessionInternalThis 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:
startCallin interfaceClientSessionInternal
-
endCall
public void endCall()
- Specified by:
endCallin interfaceClientSessionInternal- See Also:
ClientSessionInternal.startCall()
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
end
public void end(Xid xid, int flags) throws XAException
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource xares) throws XAException
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
recover
public Xid[] recover(int flags) throws XAException
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
start
public void start(Xid xid, int flags) throws XAException
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
connectionFailed
public void connectionFailed(ActiveMQException me, boolean failedOver)
Description copied from interface:FailureListenerNotifies that a connection has failed due to the specified exception.- Specified by:
connectionFailedin interfaceFailureListener- Parameters:
me- exception which has caused the connection to fail
-
connectionFailed
public void connectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
Description copied from interface:FailureListenerNotifies that a connection has failed due to the specified exception.- Specified by:
connectionFailedin interfaceFailureListener- Parameters:
me- exception which has caused the connection to failscaleDownTargetNodeID- the ID of the node to which messages are scaling down
-
setForceNotSameRM
public void setForceNotSameRM(boolean force)
- Specified by:
setForceNotSameRMin interfaceClientSessionInternal
-
getConnection
public RemotingConnection getConnection()
- Specified by:
getConnectionin interfaceClientSessionInternal
-
cloneProducers
public Set<ClientProducerInternal> cloneProducers()
Not part of the interface, used on tests only- Returns:
-
cloneConsumers
public Set<ClientConsumerInternal> cloneConsumers()
Not part of the interface, used on tests only- Returns:
-
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
- Parameters:
xid-- Returns:
-
setStopSignal
public void setStopSignal()
Description copied from interface:ClientSessionInternalSets a stop signal to true. This will cancel- Specified by:
setStopSignalin interfaceClientSessionInternal
-
isConfirmationWindowEnabled
public boolean isConfirmationWindowEnabled()
- Specified by:
isConfirmationWindowEnabledin interfaceClientSessionInternal
-
scheduleConfirmation
public void scheduleConfirmation(SendAcknowledgementHandler handler, Message message)
- Specified by:
scheduleConfirmationin interfaceClientSessionInternal
-
getSessionContext
public SessionContext getSessionContext()
- Specified by:
getSessionContextin interfaceClientSessionInternal
-
-