public final class ClientSessionImpl extends Object implements ClientSessionInternal, FailureListener
ClientSession.AddressQuery, ClientSession.QueueQuery
JMS_SESSION_IDENTIFIER_PROPERTY
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(ClientConsumer consumer,
Message message)
Acknowledges all messages received by the consumer so far.
|
void |
addConsumer(ClientConsumerInternal consumer) |
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.
|
void |
addProducer(ClientProducerInternal producer) |
ClientSession.AddressQuery |
addressQuery(SimpleString address)
Queries information on a binding.
|
void |
addUniqueMetaData(String key,
String data)
Attach any metadata to the session.
|
void |
cleanUp(boolean failingOver) |
Map<ConsumerContext,ClientConsumerInternal> |
cloneConsumerEntries() |
Set<ClientConsumerInternal> |
cloneConsumers()
Not part of the interface, used on tests only
|
Set<ClientProducerInternal> |
cloneProducers()
Not part of the interface, used on tests only
|
void |
close()
Closes the session.
|
void |
commit()
Commits the current transaction, blocking.
|
void |
commit(boolean block)
Commits the current transaction.
|
void |
commit(Xid xid,
boolean onePhase) |
void |
connectionFailed(ActiveMQException me,
boolean failedOver)
Notifies that a connection has failed due to the specified exception.
|
void |
connectionFailed(ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID)
Notifies that a connection has failed due to the specified exception.
|
static Object |
convert(Xid xid)
If you ever tried to debug XIDs you will know what this is about.
|
void |
createAddress(SimpleString address,
EnumSet<RoutingType> routingTypes,
boolean autoCreated)
Create Address with a single initial routing type
|
void |
createAddress(SimpleString address,
RoutingType routingType,
boolean autoCreated)
Create Address with a single initial routing type
|
void |
createAddress(SimpleString address,
Set<RoutingType> routingTypes,
boolean autoCreated)
Create Address with a single initial routing type
|
ClientConsumer |
createConsumer(SimpleString queueName)
Creates a ClientConsumer to consume message from the queue with the given name.
|
ClientConsumer |
createConsumer(SimpleString queueName,
boolean browseOnly)
Creates a ClientConsumer to consume or browse messages from the queue with the given name.
|
ClientConsumer |
createConsumer(SimpleString queueName,
SimpleString filterString)
Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
|
ClientConsumer |
createConsumer(SimpleString queueName,
SimpleString filterString,
boolean browseOnly)
Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
the given name.
|
ClientConsumer |
createConsumer(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.
|
ClientConsumer |
createConsumer(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.
|
ClientConsumer |
createConsumer(SimpleString queueName,
SimpleString filterString,
int priority,
int windowSize,
int maxRate,
boolean browseOnly)
Note, we DO NOT currently support direct consumers (i.e.
|
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 filterString)
Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
|
ClientConsumer |
createConsumer(String queueName,
String filterString,
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 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.
|
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(SimpleString address)
Creates a producer which sends messages to the given address
|
ClientProducer |
createProducer(SimpleString address,
int maxRate)
Creates a producer which sends messages to the given address
|
ClientProducer |
createProducer(String address)
Creates a producer which sends messages to the given address
|
ClientProducer |
createProducer(String address,
int rate) |
void |
createQueue(QueueConfiguration queueConfiguration)
This method creates a queue based on the
QueueConfiguration input. |
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
boolean durable)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filter,
boolean durable)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean autoCreated)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean autoCreated,
int maxConsumers,
boolean purgeOnNoConsumers)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean autoCreated,
int maxConsumers,
boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Deprecated.
|
void |
createQueue(SimpleString address,
SimpleString queueName)
Creates a non-temporary queue non-durable queue.
|
void |
createQueue(SimpleString address,
SimpleString queueName,
boolean durable)
Creates a non-temporary queue.
|
void |
createQueue(SimpleString address,
SimpleString queueName,
boolean autoCreated,
QueueAttributes queueAttributes)
Deprecated.
|
void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable)
Creates a non-temporary queue.
|
void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean autoCreated)
Creates a non-temporary queue.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName)
Deprecated.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName,
boolean durable)
Creates a non-temporary queue.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName,
String filter,
boolean durable)
Creates a non-temporaryqueue.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName,
String filterString,
boolean durable,
boolean autoCreated)
Creates a non-temporaryqueue.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName,
String filterString,
boolean durable,
boolean autoCreated,
int maxConsumers,
boolean purgeOnNoConsumers)
Deprecated.
|
void |
createQueue(String address,
RoutingType routingType,
String queueName,
String filterString,
boolean durable,
boolean autoCreated,
int maxConsumers,
boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Creates a non-temporaryqueue.
|
void |
createQueue(String address,
String queueName)
Creates a non-temporary queue non-durable queue.
|
void |
createQueue(String address,
String queueName,
boolean durable)
Creates a non-temporary queue.
|
void |
createQueue(String address,
String queueName,
String filterString,
boolean durable)
Creates a non-temporaryqueue.
|
void |
createQueue(String address,
String queueName,
String filterString,
boolean durable,
boolean autoCreated)
Creates a non-temporaryqueue.
|
void |
createSharedQueue(QueueConfiguration queueConfiguration)
This method is essentially the same as
ClientSession.createQueue(QueueConfiguration) with a few key exceptions. |
void |
createSharedQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
boolean durable)
Creates a transient queue.
|
void |
createSharedQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filter,
boolean durable)
Creates a transient queue.
|
void |
createSharedQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filter,
boolean durable,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Deprecated.
|
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
boolean durable)
Creates a transient queue.
|
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
QueueAttributes queueAttributes)
Deprecated.
|
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable)
Creates a transient queue.
|
void |
createTemporaryQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName)
Creates a temporary queue.
|
void |
createTemporaryQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filter)
Deprecated.
|
void |
createTemporaryQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filter,
int maxConsumers,
boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Deprecated.
|
void |
createTemporaryQueue(SimpleString address,
SimpleString queueName)
Creates a temporary queue.
|
void |
createTemporaryQueue(SimpleString address,
SimpleString queueName,
QueueAttributes queueAttributes)
Deprecated.
|
void |
createTemporaryQueue(SimpleString address,
SimpleString queueName,
SimpleString filter)
Creates a temporary queue with a filter.
|
void |
createTemporaryQueue(String address,
RoutingType routingType,
String queueName)
Creates a temporary queue.
|
void |
createTemporaryQueue(String address,
RoutingType routingType,
String queueName,
String filter)
Creates a temporary queue with a filter.
|
void |
createTemporaryQueue(String address,
String queueName)
Creates a temporary queue.
|
void |
createTemporaryQueue(String address,
String queueName,
String filter)
Creates a temporary queue with a filter.
|
void |
deleteQueue(SimpleString queueName)
Deletes the queue.
|
void |
deleteQueue(String queueName)
Deletes the queue.
|
void |
end(Xid xid,
int flags) |
void |
endCall() |
void |
expire(ClientConsumer consumer,
Message message) |
void |
forget(Xid xid) |
RemotingConnection |
getConnection() |
ClientProducerCredits |
getCredits(SimpleString address,
boolean anon) |
int |
getMinLargeMessageSize() |
String |
getName() |
String |
getNodeId() |
ClientProducerCreditManager |
getProducerCreditManager() |
SessionContext |
getSessionContext() |
ClientSessionFactory |
getSessionFactory()
Return the sessionFactory used to created this Session.
|
int |
getTransactionTimeout() |
int |
getVersion()
Returns the server's incrementingVersion.
|
XAResource |
getXAResource()
Returns the XAResource associated to the session.
|
void |
handleConsumerDisconnect(ConsumerContext context) |
boolean |
handleFailover(RemotingConnection backupConnection,
ActiveMQException cause) |
void |
handleReceiveContinuation(ConsumerContext consumerID,
byte[] chunk,
int flowControlSize,
boolean isContinues) |
void |
handleReceiveLargeMessage(ConsumerContext consumerID,
ClientLargeMessageInternal clientLargeMessage,
long largeMessageSize) |
void |
handleReceiveMessage(ConsumerContext consumerID,
ClientMessageInternal message) |
void |
handleReceiveProducerCredits(SimpleString address,
int credits) |
void |
handleReceiveProducerFailCredits(SimpleString address,
int credits) |
void |
individualAcknowledge(ClientConsumer consumer,
Message message) |
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 |
isCacheLargeMessageClient() |
boolean |
isClosed()
Returns whether the session is closed or not.
|
boolean |
isClosing() |
boolean |
isCompressLargeMessages() |
boolean |
isConfirmationWindowEnabled() |
boolean |
isRollbackOnly()
Returns
true if the current transaction has been flagged to rollback, false else. |
boolean |
isSameRM(XAResource xares) |
boolean |
isWritable(ReadyListener callback) |
boolean |
isXA()
Return
true if the session supports XA, false else. |
void |
markRollbackOnly() |
void |
preHandleFailover(RemotingConnection connection) |
int |
prepare(Xid xid) |
ClientSession.QueueQuery |
queueQuery(SimpleString queueName)
Queries information on a queue.
|
Xid[] |
recover(int flags) |
void |
removeConsumer(ClientConsumerInternal consumer) |
boolean |
removeFailoverListener(FailoverEventListener listener)
Removes a FailoverEventListener to the session.
|
boolean |
removeFailureListener(SessionFailureListener listener)
Removes a FailureListener to the session.
|
void |
removeProducer(ClientProducerInternal producer) |
void |
resetIfNeeded() |
void |
returnCredits(SimpleString address) |
void |
rollback()
Rolls back the current transaction.
|
void |
rollback(boolean isLastMessageAsDelivered)
Rolls back the current transaction.
|
void |
rollback(boolean isLastMessageAsDelivered,
boolean waitConsumers) |
void |
rollback(Xid xid) |
void |
scheduleConfirmation(SendAcknowledgementHandler handler,
Message message) |
void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
void |
setAddress(Message message,
SimpleString address)
This will set the address at the message
|
void |
setForceNotSameRM(boolean force) |
void |
setPacketSize(int packetSize) |
ClientSessionImpl |
setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
Sets a
SendAcknowledgementHandler for this session. |
void |
setStopSignal()
Sets a stop signal to true.
|
boolean |
setTransactionTimeout(int seconds) |
ClientSessionImpl |
start()
Starts the session.
|
void |
start(Xid xid,
int flags) |
void |
startCall()
This is used internally to control and educate the user
about using the thread boundaries properly.
|
void |
stop()
Stops the session.
|
void |
stop(boolean waitForOnMessage) |
String |
toString() |
void |
workDone() |
public void createQueue(SimpleString address, SimpleString queueName) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queuedurable
- whether the queue is durable or notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, String queueName, boolean durable) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queuedurable
- whether the queue is durable or notActiveMQException
- in an exception occurs while creating the queuepublic void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException
ClientSession
Notice: you will get an exception if the address or the filter doesn't match to an already existent queue
createSharedQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queuedurable
- if the queue is durableActiveMQException
- in an exception occurs while creating the queuepublic void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
ClientSession
Notice: you will get an exception if the address or the filter doesn't match to an already existent queue
createSharedQueue
in interface ClientSession
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 durableActiveMQException
- in an exception occurs while creating the queuepublic void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
ClientSession
createAddress
in interface ClientSession
ActiveMQException
public void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
ClientSession
createAddress
in interface ClientSession
ActiveMQException
public void createAddress(SimpleString address, RoutingType routingType, boolean autoCreated) throws ActiveMQException
ClientSession
createAddress
in interface ClientSession
ActiveMQException
public void createQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
ClientSession
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
:
transient
: false
temporary
: false
durable
: true
autoCreated
: false
internal
: false
configurationManaged
: false
maxConsumers
: ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()
purgeOnNoConsumers
: ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers()
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
createQueue
in interface ClientSession
queueConfiguration
- the configuration to use when creating the queueActiveMQException
public void createSharedQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
ClientSession
ClientSession.createQueue(QueueConfiguration)
with a few key exceptions.
If durable
is true
then:
transient
will be forced to false
temporary
will be forced to false
If durable
is false
then:
transient
will be forced to true
temporary
will be forced to true
In all instances autoCreated
will be forced to false
and autoCreatedAddress
will be forced
to true
.
createSharedQueue
in interface ClientSession
ActiveMQException
ClientSession.createQueue(QueueConfiguration)
public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, String queueName, String filterString, boolean durable) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, String queueName, String filterString, boolean durable, boolean autoCreated) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(SimpleString address, SimpleString queueName) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(String address, String queueName) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(String address, String queueName, String filter) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated) throws ActiveMQException
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, RoutingType routingType, String queueName, String filterString, boolean durable, boolean autoCreated) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 disconnectsActiveMQException
@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
ClientSession
createQueue
in interface ClientSession
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 lastValueActiveMQException
@Deprecated public void createQueue(SimpleString address, SimpleString queueName, boolean autoCreated, QueueAttributes queueAttributes) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 queueActiveMQException
@Deprecated public void createQueue(String address, RoutingType routingType, String queueName, String filterString, boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
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 disconnectsActiveMQException
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
ClientSession
createQueue
in interface ClientSession
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 lastValueActiveMQException
public void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
address
- the queue will be bound to this addressroutingType
- the routing type for this queue, MULTICAST or ANYCASTqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
address
- the queue will be bound to this addressroutingType
- the routing type for this queue, MULTICAST or ANYCASTqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, int maxConsumers, boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createTemporaryQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queuequeueAttributes
- attributes for the queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createTemporaryQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queuepublic void createTemporaryQueue(String address, RoutingType routingType, String queueName, String filter) throws ActiveMQException
ClientSession
createTemporaryQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, boolean durable) throws ActiveMQException
Notice: you will get an exception if the address or the filter doesn't match to an already existent queue
createSharedQueue
in interface ClientSession
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 durableActiveMQException
- in an exception occurs while creating the queuepublic void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException
Notice: you will get an exception if the address or the filter doesn't match to an already existent queue
createSharedQueue
in interface ClientSession
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 durableActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createSharedQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
createSharedQueue
in interface ClientSession
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 queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException
createSharedQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queuequeueAttributes
- attributes for the queueActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, RoutingType routingType, String queueName, boolean durable) throws ActiveMQException
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException
createQueue
in interface ClientSession
address
- the queue will be bound to this addressroutingType
- the delivery mode for this queue, MULTICAST or ANYCASTqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName) throws ActiveMQException
createQueue
in interface ClientSession
address
- the queue will be bound to this addressroutingType
- the delivery mode for this queue, MULTICAST or ANYCASTqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queue@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException
createQueue
in interface ClientSession
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 notActiveMQException
- in an exception occurs while creating the queuepublic void deleteQueue(SimpleString queueName) throws ActiveMQException
ClientSession
deleteQueue
in interface ClientSession
queueName
- the name of the queue to deleteActiveMQException
- if there is no queue for the given name or if the queue has consumerspublic void deleteQueue(String queueName) throws ActiveMQException
ClientSession
deleteQueue
in interface ClientSession
queueName
- the name of the queue to deleteActiveMQException
- if there is no queue for the given name or if the queue has consumerspublic ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
ClientSession
queueQuery
in interface ClientSession
queueName
- the name of the queue to queryActiveMQException
- if an exception occurs while querying the queuepublic ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
ClientSession
addressQuery
in interface ClientSession
address
- the address of the biding to queryActiveMQException
- if an exception occurs while querying the bindingpublic ClientConsumer createConsumer(SimpleString queueName) throws ActiveMQException
ClientSession
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages fromActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(String queueName) throws ActiveMQException
ClientSession
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages fromActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString) throws ActiveMQException
ClientSession
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages fromfilterString
- only messages which match this filter will be consumedActiveMQException
- if an exception occurs while creating the ClientConsumerpublic void createQueue(String address, String queueName) throws ActiveMQException
ClientSession
createQueue
in interface ClientSession
address
- the queue will be bound to this addressqueueName
- the name of the queueActiveMQException
- in an exception occurs while creating the queuepublic ClientConsumer createConsumer(String queueName, String filterString) throws ActiveMQException
ClientSession
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages fromfilterString
- only messages which match this filter will be consumedActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString, int priority, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(SimpleString queueName, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages frombrowseOnly
- whether the ClientConsumer will only browse the queue or consume messages.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(String queueName, String filterString, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(String queueName, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
queueName
- name of the queue to consume messages frombrowseOnly
- whether the ClientConsumer will only browse the queue or consume messages.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic boolean isWritable(ReadyListener callback)
isWritable
in interface ClientSessionInternal
public ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientConsumer createConsumer(String queueName, String filterString, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException
ClientSession
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.
createConsumer
in interface ClientSession
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.ActiveMQException
- if an exception occurs while creating the ClientConsumerpublic ClientProducer createProducer() throws ActiveMQException
ClientSession
createProducer
in interface ClientSession
ActiveMQException
ClientProducer.send(SimpleString, org.apache.activemq.artemis.api.core.Message)
public ClientProducer createProducer(SimpleString address) throws ActiveMQException
ClientSession
createProducer
in interface ClientSession
address
- the address to send messages toActiveMQException
- if an exception occurs while creating the ClientProducerpublic ClientProducer createProducer(String address) throws ActiveMQException
ClientSession
createProducer
in interface ClientSession
address
- the address to send messages toActiveMQException
- if an exception occurs while creating the ClientProducerpublic ClientProducer createProducer(SimpleString address, int maxRate) throws ActiveMQException
ClientSession
createProducer
in interface ClientSession
address
- the address to send messages tomaxRate
- the producer rateActiveMQException
- if an exception occurs while creating the ClientProducerpublic ClientProducer createProducer(String address, int rate) throws ActiveMQException
ActiveMQException
public XAResource getXAResource()
ClientSession
getXAResource
in interface ClientSession
public void commit() throws ActiveMQException
ClientSession
commit
in interface ClientSession
ActiveMQException
- if an exception occurs while committing the transactionpublic void commit(boolean block) throws ActiveMQException
ClientSession
commit
in interface ClientSession
block
- if the commit will be blocking or not.ActiveMQException
- if an exception occurs while committing the transactionpublic boolean isRollbackOnly()
ClientSession
true
if the current transaction has been flagged to rollback, false
else.isRollbackOnly
in interface ClientSession
true
if the current transaction has been flagged to rollback, false
else.public void rollback() throws ActiveMQException
ClientSession
rollback
in interface ClientSession
ActiveMQException
- if an exception occurs while rolling back the transactionpublic void rollback(boolean isLastMessageAsDelivered) throws ActiveMQException
ClientSession
rollback
in interface ClientSession
isLastMessageAsDelivered
- the first message on deliveringMessage Buffer is considered as deliveredActiveMQException
- if an exception occurs while rolling back the transactionpublic void rollback(boolean isLastMessageAsDelivered, boolean waitConsumers) throws ActiveMQException
ActiveMQException
public void markRollbackOnly()
markRollbackOnly
in interface ClientSessionInternal
public ClientMessage createMessage(byte type, boolean durable, long expiration, long timestamp, byte priority)
ClientSession
createMessage
in interface ClientSession
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)public ClientMessage createMessage(byte type, boolean durable)
ClientSession
createMessage
in interface ClientSession
type
- type of the messagedurable
- whether the created message is durable or notpublic ClientMessage createMessage(boolean durable)
ClientSession
createMessage
in interface ClientSession
durable
- whether the created message is durable or notpublic boolean isClosed()
ClientSession
isClosed
in interface ClientSession
true
if the session is closed, false
elsepublic boolean isAutoCommitSends()
ClientSession
false
elseisAutoCommitSends
in interface ClientSession
true
if the session automatically commit its transaction every time a message is sent, false
elsepublic boolean isAutoCommitAcks()
ClientSession
false
elseisAutoCommitAcks
in interface ClientSession
true
if the session automatically commit its transaction every time a message is acknowledged, false
elsepublic boolean isBlockOnAcknowledge()
ClientSession
isBlockOnAcknowledge
in interface ClientSession
true
if the session's ClientConsumer block when they acknowledge a message, false
elsepublic boolean isXA()
ClientSession
true
if the session supports XA, false
else.isXA
in interface ClientSession
true
if the session supports XA, false
else.public void resetIfNeeded() throws ActiveMQException
resetIfNeeded
in interface ClientSessionInternal
ActiveMQException
public ClientSessionImpl start() throws ActiveMQException
ClientSession
start
in interface ClientSession
ActiveMQException
- if an exception occurs while starting the sessionpublic void stop() throws ActiveMQException
ClientSession
stop
in interface ClientSession
ActiveMQException
- if an exception occurs while stopping the sessionpublic void stop(boolean waitForOnMessage) throws ActiveMQException
ActiveMQException
public void addFailureListener(SessionFailureListener listener)
ClientSession
addFailureListener
in interface ClientSession
listener
- the listener to addpublic boolean removeFailureListener(SessionFailureListener listener)
ClientSession
removeFailureListener
in interface ClientSession
listener
- the listener to removetrue
if the listener was removed, false
elsepublic void addFailoverListener(FailoverEventListener listener)
ClientSession
addFailoverListener
in interface ClientSession
listener
- the listener to addpublic boolean removeFailoverListener(FailoverEventListener listener)
ClientSession
removeFailoverListener
in interface ClientSession
listener
- the listener to removetrue
if the listener was removed, false
elsepublic int getVersion()
ClientSession
getVersion
in interface ClientSession
incrementingVersion
public boolean isClosing()
isClosing
in interface ClientSessionInternal
public String getNodeId()
getNodeId
in interface ClientSessionInternal
public int getMinLargeMessageSize()
getMinLargeMessageSize
in interface ClientSessionInternal
public boolean isCompressLargeMessages()
isCompressLargeMessages
in interface ClientSessionInternal
public boolean isCacheLargeMessageClient()
isCacheLargeMessageClient
in interface ClientSessionInternal
public String getName()
getName
in interface ClientSessionInternal
public void acknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
acknowledge
in interface ClientSessionInternal
ActiveMQException
public void individualAcknowledge(ClientConsumer consumer, Message message) throws ActiveMQException
individualAcknowledge
in interface ClientSessionInternal
ActiveMQException
public void expire(ClientConsumer consumer, Message message) throws ActiveMQException
expire
in interface ClientSessionInternal
ActiveMQException
public void addConsumer(ClientConsumerInternal consumer)
addConsumer
in interface ClientSessionInternal
public void addProducer(ClientProducerInternal producer)
addProducer
in interface ClientSessionInternal
public void removeConsumer(ClientConsumerInternal consumer) throws ActiveMQException
removeConsumer
in interface ClientSessionInternal
ActiveMQException
public void removeProducer(ClientProducerInternal producer)
removeProducer
in interface ClientSessionInternal
public void handleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message) throws Exception
handleReceiveMessage
in interface ClientSessionInternal
Exception
public void handleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception
handleReceiveLargeMessage
in interface ClientSessionInternal
Exception
public void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
handleReceiveContinuation
in interface ClientSessionInternal
Exception
public void handleConsumerDisconnect(ConsumerContext context) throws ActiveMQException
handleConsumerDisconnect
in interface ClientSessionInternal
ActiveMQException
public void close() throws ActiveMQException
ClientSession
close
in interface AutoCloseable
close
in interface ClientSession
ActiveMQException
- if an exception occurs while closing the sessionpublic void cleanUp(boolean failingOver) throws ActiveMQException
cleanUp
in interface ClientSessionInternal
ActiveMQException
public ClientSessionImpl setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
ClientSession
SendAcknowledgementHandler
for this session.setSendAcknowledgementHandler
in interface ClientSession
handler
- a SendAcknowledgementHandlerpublic void preHandleFailover(RemotingConnection connection)
preHandleFailover
in interface ClientSessionInternal
public boolean handleFailover(RemotingConnection backupConnection, ActiveMQException cause)
handleFailover
in interface ClientSessionInternal
public void addMetaData(String key, String data) throws ActiveMQException
ClientSession
addMetaData
in interface ClientSession
ActiveMQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
ClientSession
addUniqueMetaData
in interface ClientSession
ActiveMQException
public ClientSessionFactory getSessionFactory()
ClientSession
getSessionFactory
in interface ClientSession
public void setAddress(Message message, SimpleString address)
ClientSessionInternal
setAddress
in interface ClientSessionInternal
public void setPacketSize(int packetSize)
setPacketSize
in interface ClientSessionInternal
public void workDone()
workDone
in interface ClientSessionInternal
public void sendProducerCreditsMessage(int credits, SimpleString address)
sendProducerCreditsMessage
in interface ClientSessionInternal
public ClientProducerCredits getCredits(SimpleString address, boolean anon)
getCredits
in interface ClientSessionInternal
public void returnCredits(SimpleString address)
returnCredits
in interface ClientSessionInternal
public void handleReceiveProducerCredits(SimpleString address, int credits)
handleReceiveProducerCredits
in interface ClientSessionInternal
public void handleReceiveProducerFailCredits(SimpleString address, int credits)
handleReceiveProducerFailCredits
in interface ClientSessionInternal
public ClientProducerCreditManager getProducerCreditManager()
getProducerCreditManager
in interface ClientSessionInternal
public void startCall()
ClientSessionInternal
startCall
in interface ClientSessionInternal
public void endCall()
endCall
in interface ClientSessionInternal
ClientSessionInternal.startCall()
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
XAException
public boolean isSameRM(XAResource xares) throws XAException
isSameRM
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public Xid[] recover(int flags) throws XAException
recover
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
XAException
public void connectionFailed(ActiveMQException me, boolean failedOver)
FailureListener
connectionFailed
in interface FailureListener
me
- exception which has caused the connection to failpublic void connectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
FailureListener
connectionFailed
in interface FailureListener
me
- exception which has caused the connection to failscaleDownTargetNodeID
- the ID of the node to which messages are scaling downpublic void setForceNotSameRM(boolean force)
setForceNotSameRM
in interface ClientSessionInternal
public RemotingConnection getConnection()
getConnection
in interface ClientSessionInternal
public Set<ClientProducerInternal> cloneProducers()
public Set<ClientConsumerInternal> cloneConsumers()
public Map<ConsumerContext,ClientConsumerInternal> cloneConsumerEntries()
public static Object convert(Xid xid)
This will convert to the same XID deserialized on the Server, hence we will be able to debug eventual stuff
xid
- public void setStopSignal()
ClientSessionInternal
setStopSignal
in interface ClientSessionInternal
public boolean isConfirmationWindowEnabled()
isConfirmationWindowEnabled
in interface ClientSessionInternal
public void scheduleConfirmation(SendAcknowledgementHandler handler, Message message)
scheduleConfirmation
in interface ClientSessionInternal
public SessionContext getSessionContext()
getSessionContext
in interface ClientSessionInternal
Copyright © 2021 JBoss by Red Hat. All rights reserved.