Class SessionContext
java.lang.Object
org.apache.activemq.artemis.spi.core.remoting.SessionContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.activemq.artemis.utils.IDGenerator
protected RemotingConnection
protected SendAcknowledgementHandler
protected org.apache.activemq.artemis.core.client.impl.ClientSessionInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ClientSession.AddressQuery
addressQuery
(SimpleString address) abstract void
addSessionMetadata
(String key, String data) abstract void
addUniqueMetaData
(String key, String data) abstract void
cleanup()
abstract void
closeConsumer
(ClientConsumer consumer) abstract boolean
configureTransactionTimeout
(int seconds) abstract void
createAddress
(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) abstract void
createAddress
(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) Deprecated.abstract org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal
createConsumer
(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor, int onMessageCloseTimeout) abstract void
createProducer
(org.apache.activemq.artemis.core.client.impl.ClientProducerInternal producer) abstract void
createQueue
(QueueConfiguration queueConfiguration) abstract void
createQueue
(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) Deprecated.abstract void
createQueue
(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastVale) abstract void
createQueue
(SimpleString address, SimpleString queueName, boolean temp, boolean autoCreated, QueueAttributes queueAttributes) abstract void
createQueue
(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) Deprecated.abstract void
createSharedQueue
(QueueConfiguration queueConfiguration) abstract void
createSharedQueue
(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) Deprecated.abstract void
createSharedQueue
(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable) Deprecated.abstract void
createSharedQueue
(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) Deprecated.abstract void
createSharedQueue
(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) Deprecated.abstract void
deleteQueue
(SimpleString queueName) abstract void
expireMessage
(ClientConsumer consumer, Message message) abstract void
forceDelivery
(ClientConsumer consumer, long sequence) abstract int
abstract int
getDefaultConsumerWindowSize
(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage response) abstract int
abstract SendAcknowledgementHandler
abstract int
org.apache.activemq.artemis.core.client.impl.ClientSessionInternal
protected void
handleReceiveContinuation
(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) protected void
handleReceiveLargeMessage
(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) protected void
handleReceiveMessage
(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientMessageInternal message) protected void
handleReceiveProducerCredits
(SimpleString address, int credits) protected void
handleReceiveProducerFailCredits
(SimpleString address, int credits) abstract boolean
isWritable
(ReadyListener callback) abstract void
linkFlowControl
(SimpleString address, org.apache.activemq.artemis.core.client.impl.ClientProducerCredits clientProducerCredits) abstract void
it will lock the communication channel of the session avoiding anything to come while failover is happening.abstract ClientSession.QueueQuery
queueQuery
(SimpleString queueName) abstract boolean
reattachOnNewConnection
(RemotingConnection newConnection) it will either reattach or reconnect, preferably reattaching it.abstract int
Performs a round trip to the server requesting what is the current tx timeout on the sessionabstract void
recreateConsumerOnServer
(org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) abstract void
recreateSession
(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) abstract void
abstract void
removeProducer
(int id) abstract void
resetMetadata
(HashMap<String, String> metaDataToSend) abstract void
abstract void
abstract void
returnBlocking
(ActiveMQException cause) Interrupt and return any blocked callsabstract void
sendACK
(boolean individual, boolean block, ClientConsumer consumer, Message message) abstract void
sendConsumerCredits
(ClientConsumer consumer, int credits) abstract void
sendFullMessage
(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress, int senderID) abstract int
it should return the number of credits (or bytes) used to send this packetabstract int
sendLargeMessageChunk
(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, int senderID, SendAcknowledgementHandler messageHandler) abstract void
sendProducerCreditsMessage
(int credits, SimpleString address) abstract int
sendServerLargeMessageChunk
(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int senderID, SendAcknowledgementHandler messageHandler) abstract void
abstract void
abstract void
abstract void
void
setSession
(org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session) abstract void
abstract void
simpleCommit
(boolean block) abstract void
simpleRollback
(boolean lastMessageAsDelivered) If we are doing a simple rollback on the RA, we need to ack the last message sent to the consumer, otherwise DLQ won't work.abstract boolean
abstract void
transferConnection
(RemotingConnection newConnection) Transfers the session context to the given newConnection on the client-sideabstract void
abstract void
abstract void
abstract void
abstract int
abstract void
xaRollback
(Xid xid, boolean wasStarted) abstract Xid[]
xaScan()
abstract void
-
Field Details
-
session
protected org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session -
sendAckHandler
-
remotingConnection
-
idGenerator
protected final org.apache.activemq.artemis.utils.IDGenerator idGenerator
-
-
Constructor Details
-
SessionContext
-
-
Method Details
-
getSession
public org.apache.activemq.artemis.core.client.impl.ClientSessionInternal getSession() -
setSession
public void setSession(org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session) -
resetName
-
getReconnectID
public abstract int getReconnectID() -
transferConnection
Transfers the session context to the given newConnection on the client-side -
reattachOnNewConnection
public abstract boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException it will either reattach or reconnect, preferably reattaching it.- Parameters:
newConnection
-- Returns:
- true if it was possible to reattach
- Throws:
ActiveMQException
-
getRemotingConnection
-
closeConsumer
- Throws:
ActiveMQException
-
sendConsumerCredits
-
supportsLargeMessage
public abstract boolean supportsLargeMessage() -
handleReceiveLargeMessage
protected void handleReceiveLargeMessage(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception - Throws:
Exception
-
handleReceiveMessage
protected void handleReceiveMessage(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientMessageInternal message) throws Exception - Throws:
Exception
-
handleReceiveContinuation
protected void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception - Throws:
Exception
-
handleReceiveProducerCredits
-
handleReceiveProducerFailCredits
-
getCreditsOnSendingFull
-
sendFullMessage
public abstract void sendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress, int senderID) throws ActiveMQException - Throws:
ActiveMQException
-
sendInitialChunkOnLargeMessage
it should return the number of credits (or bytes) used to send this packet- Parameters:
msgI
-- Returns:
- Throws:
ActiveMQException
-
sendLargeMessageChunk
public abstract int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, int senderID, SendAcknowledgementHandler messageHandler) throws ActiveMQException - Throws:
ActiveMQException
-
sendServerLargeMessageChunk
public abstract int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int senderID, SendAcknowledgementHandler messageHandler) throws ActiveMQException - Throws:
ActiveMQException
-
setSendAcknowledgementHandler
-
getSendAcknowledgementHandler
-
deleteQueue
- Throws:
ActiveMQException
-
createAddress
@Deprecated public abstract void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException Deprecated.- Throws:
ActiveMQException
-
createAddress
public abstract void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException - Throws:
ActiveMQException
-
createQueue
@Deprecated public abstract void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) throws ActiveMQException Deprecated.- Throws:
ActiveMQException
-
createQueue
@Deprecated public abstract void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) throws ActiveMQException Deprecated.- Throws:
ActiveMQException
-
createQueue
public abstract void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastVale) throws ActiveMQException - Throws:
ActiveMQException
-
createQueue
public abstract void createQueue(SimpleString address, SimpleString queueName, boolean temp, boolean autoCreated, QueueAttributes queueAttributes) throws ActiveMQException - Throws:
ActiveMQException
-
createQueue
- Throws:
ActiveMQException
-
queueQuery
public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException - Throws:
ActiveMQException
-
forceDelivery
- Throws:
ActiveMQException
-
addressQuery
public abstract ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException - Throws:
ActiveMQException
-
simpleCommit
- Throws:
ActiveMQException
-
simpleCommit
- Throws:
ActiveMQException
-
simpleRollback
If we are doing a simple rollback on the RA, we need to ack the last message sent to the consumer, otherwise DLQ won't work.this is because we only ACK after on the RA, We may review this if we always acked earlier.
- Parameters:
lastMessageAsDelivered
-- Throws:
ActiveMQException
-
sessionStart
- Throws:
ActiveMQException
-
sessionStop
- Throws:
ActiveMQException
-
sendACK
public abstract void sendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) throws ActiveMQException - Throws:
ActiveMQException
-
expireMessage
public abstract void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException - Throws:
ActiveMQException
-
sessionClose
- Throws:
ActiveMQException
-
addSessionMetadata
- Throws:
ActiveMQException
-
addUniqueMetaData
- Throws:
ActiveMQException
-
sendProducerCreditsMessage
-
xaCommit
- Throws:
XAException
ActiveMQException
-
xaEnd
- Throws:
XAException
ActiveMQException
-
xaForget
- Throws:
XAException
ActiveMQException
-
xaPrepare
- Throws:
XAException
ActiveMQException
-
xaScan
- Throws:
ActiveMQException
-
xaRollback
- Throws:
ActiveMQException
XAException
-
xaStart
- Throws:
XAException
ActiveMQException
-
configureTransactionTimeout
- Throws:
ActiveMQException
-
createConsumer
public abstract org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor, int onMessageCloseTimeout) throws ActiveMQException - Throws:
ActiveMQException
-
recoverSessionTimeout
Performs a round trip to the server requesting what is the current tx timeout on the session- Returns:
- Throws:
ActiveMQException
-
getServerVersion
public abstract int getServerVersion() -
recreateSession
public abstract void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException - Throws:
ActiveMQException
-
recreateConsumerOnServer
public abstract void recreateConsumerOnServer(org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) throws ActiveMQException - Throws:
ActiveMQException
-
xaFailed
- Throws:
ActiveMQException
-
restartSession
- Throws:
ActiveMQException
-
resetMetadata
-
getDefaultConsumerWindowSize
public abstract int getDefaultConsumerWindowSize(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage response) throws ActiveMQException - Throws:
ActiveMQException
-
returnBlocking
Interrupt and return any blocked calls -
lockCommunications
public abstract void lockCommunications()it will lock the communication channel of the session avoiding anything to come while failover is happening. It happens on preFailover from ClientSessionImpl -
releaseCommunications
public abstract void releaseCommunications() -
cleanup
public abstract void cleanup() -
linkFlowControl
public abstract void linkFlowControl(SimpleString address, org.apache.activemq.artemis.core.client.impl.ClientProducerCredits clientProducerCredits) -
isWritable
-
createProducer
public abstract void createProducer(org.apache.activemq.artemis.core.client.impl.ClientProducerInternal producer) -
removeProducer
public abstract void removeProducer(int id)
-