Class SessionContext
java.lang.Object
org.apache.activemq.artemis.spi.core.remoting.SessionContext
- Direct Known Subclasses:
ActiveMQSessionContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IDGeneratorprotected RemotingConnectionprotected SendAcknowledgementHandlerprotected ClientSessionInternal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ClientSession.AddressQueryaddressQuery(SimpleString address) abstract voidaddSessionMetadata(String key, String data) abstract voidaddUniqueMetaData(String key, String data) abstract voidcleanup()abstract voidcloseConsumer(ClientConsumer consumer) abstract booleanconfigureTransactionTimeout(int seconds) abstract voidcreateAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) abstract voidcreateAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) Deprecated.abstract ClientConsumerInternalcreateConsumer(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor, int onMessageCloseTimeout) abstract voidcreateProducer(ClientProducerInternal producer) abstract voidcreateQueue(QueueConfiguration queueConfiguration) abstract voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) Deprecated.abstract voidcreateQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastVale) abstract voidcreateQueue(SimpleString address, SimpleString queueName, boolean temp, boolean autoCreated, QueueAttributes queueAttributes) abstract voidcreateQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) Deprecated.abstract voidcreateSharedQueue(QueueConfiguration queueConfiguration) abstract voidcreateSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) Deprecated.abstract voidcreateSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable) Deprecated.abstract voidcreateSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) Deprecated.abstract voidcreateSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) Deprecated.abstract voiddeleteQueue(SimpleString queueName) abstract voidexpireMessage(ClientConsumer consumer, Message message) abstract voidforceDelivery(ClientConsumer consumer, long sequence) abstract intabstract intabstract intabstract SendAcknowledgementHandlerabstract intprotected voidhandleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) protected voidhandleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) protected voidhandleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message) protected voidhandleReceiveProducerCredits(SimpleString address, int credits) protected voidhandleReceiveProducerFailCredits(SimpleString address, int credits) abstract booleanisWritable(ReadyListener callback) abstract voidlinkFlowControl(SimpleString address, ClientProducerCredits clientProducerCredits) abstract voidit will lock the communication channel of the session avoiding anything to come while failover is happening.abstract ClientSession.QueueQueryqueueQuery(SimpleString queueName) abstract booleanreattachOnNewConnection(RemotingConnection newConnection) it will either reattach or reconnect, preferably reattaching it.abstract intPerforms a round trip to the server requesting what is the current tx timeout on the sessionabstract voidrecreateConsumerOnServer(ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) abstract voidrecreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) abstract voidabstract voidremoveProducer(int id) abstract voidresetMetadata(Map<String, String> metaDataToSend) abstract voidabstract voidabstract voidreturnBlocking(ActiveMQException cause) Interrupt and return any blocked callsabstract voidsendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) abstract voidsendConsumerCredits(ClientConsumer consumer, int credits) abstract voidsendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress, int senderID) abstract intit should return the number of credits (or bytes) used to send this packetabstract intsendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, int senderID, SendAcknowledgementHandler messageHandler) abstract voidsendProducerCreditsMessage(int credits, SimpleString address) abstract intsendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int senderID, SendAcknowledgementHandler messageHandler) abstract voidabstract voidabstract voidabstract voidvoidsetSession(ClientSessionInternal session) abstract voidabstract voidsimpleCommit(boolean block) abstract voidsimpleRollback(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 booleanabstract voidtransferConnection(RemotingConnection newConnection) Transfers the session context to the given newConnection on the client-sideabstract voidabstract voidabstract voidabstract voidabstract intabstract voidxaRollback(Xid xid, boolean wasStarted) abstract Xid[]xaScan()abstract void
-
Field Details
-
session
-
sendAckHandler
-
remotingConnection
-
idGenerator
-
-
Constructor Details
-
SessionContext
-
-
Method Details
-
getSession
-
setSession
-
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.- 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, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception - Throws:
Exception
-
handleReceiveMessage
protected void handleReceiveMessage(ConsumerContext consumerID, 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- 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.
- 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:
XAExceptionActiveMQException
-
xaEnd
- Throws:
XAExceptionActiveMQException
-
xaForget
- Throws:
XAExceptionActiveMQException
-
xaPrepare
- Throws:
XAExceptionActiveMQException
-
xaScan
- Throws:
ActiveMQException
-
xaRollback
- Throws:
ActiveMQExceptionXAException
-
xaStart
- Throws:
XAExceptionActiveMQException
-
configureTransactionTimeout
- Throws:
ActiveMQException
-
createConsumer
public abstract 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- 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(ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) throws ActiveMQException - Throws:
ActiveMQException
-
xaFailed
- Throws:
ActiveMQException
-
restartSession
- Throws:
ActiveMQException
-
resetMetadata
-
getDefaultConsumerWindowSize
public abstract int getDefaultConsumerWindowSize(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, ClientProducerCredits clientProducerCredits) -
isWritable
-
createProducer
-
removeProducer
public abstract void removeProducer(int id)
-