public class ActiveMQSessionContext extends SessionContext
idGenerator, remotingConnection, sendAckHandler, session| Constructor and Description |
|---|
ActiveMQSessionContext(String name,
RemotingConnection remotingConnection,
Channel sessionChannel,
int serverVersion,
int confirmationWindow) |
| Modifier and Type | Method and Description |
|---|---|
ClientSession.AddressQuery |
addressQuery(org.apache.activemq.artemis.api.core.SimpleString address) |
void |
addSessionMetadata(String key,
String data) |
void |
addUniqueMetaData(String key,
String data) |
protected int |
calcWindowSize(int windowSize) |
void |
cleanup() |
void |
closeConsumer(ClientConsumer consumer) |
boolean |
configureTransactionTimeout(int seconds) |
ClientConsumerInternal |
createConsumer(org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
void |
createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
boolean temp) |
void |
createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable) |
void |
deleteQueue(org.apache.activemq.artemis.api.core.SimpleString queueName) |
void |
expireMessage(ClientConsumer consumer,
Message message) |
void |
forceDelivery(ClientConsumer consumer,
long sequence) |
protected int |
getConfirmationWindow() |
int |
getCreditsOnSendingFull(MessageInternal msgI) |
protected String |
getName() |
int |
getReconnectID() |
int |
getServerVersion() |
protected Channel |
getSessionChannel() |
protected void |
handleReceiveProducerCredits(SessionProducerCreditsMessage message) |
protected void |
handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message) |
protected void |
handleReceiveSlowConsumerKillMessage(DisconnectConsumerWithKillMessage message) |
boolean |
isKilled() |
boolean |
isWritable(ReadyListener callback) |
void |
kill() |
void |
linkFlowControl(org.apache.activemq.artemis.api.core.SimpleString address,
ClientProducerCreditsImpl clientProducerCredits) |
void |
lockCommunications()
it will lock the communication channel of the session avoiding anything to come while failover is happening.
|
protected ClassLoader |
lookupTCCL() |
protected CreateSessionMessage |
newCreateSession(String username,
String password,
int minLargeMessageSize,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge) |
ClientSession.QueueQuery |
queueQuery(org.apache.activemq.artemis.api.core.SimpleString queueName) |
boolean |
reattachOnNewConnection(RemotingConnection newConnection)
it will eather reattach or reconnect, preferably reattaching it.
|
int |
recoverSessionTimeout()
Performs a round trip to the server requesting what is the current tx timeout on the session
|
void |
recreateConsumerOnServer(ClientConsumerInternal consumerInternal) |
void |
recreateSession(String username,
String password,
int minLargeMessageSize,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge) |
void |
releaseCommunications() |
void |
resetMetadata(HashMap<String,String> metaDataToSend) |
void |
resetName(String name) |
void |
restartSession() |
void |
returnBlocking(org.apache.activemq.artemis.api.core.ActiveMQException cause)
Interrupt and return any blocked calls
|
void |
sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message) |
void |
sendConsumerCredits(ClientConsumer consumer,
int credits) |
void |
sendFullMessage(MessageInternal msgI,
boolean sendBlocking,
SendAcknowledgementHandler handler,
org.apache.activemq.artemis.api.core.SimpleString defaultAddress) |
int |
sendInitialChunkOnLargeMessage(MessageInternal msgI)
it should return the number of credits (or bytes) used to send this packet
|
int |
sendLargeMessageChunk(MessageInternal msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
int reconnectID,
SendAcknowledgementHandler messageHandler) |
void |
sendProducerCreditsMessage(int credits,
org.apache.activemq.artemis.api.core.SimpleString address) |
int |
sendServerLargeMessageChunk(MessageInternal msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
SendAcknowledgementHandler messageHandler) |
void |
sessionClose() |
void |
sessionStart() |
void |
sessionStop() |
void |
setSendAcknowledgementHandler(SendAcknowledgementHandler handler) |
void |
simpleCommit() |
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.
|
boolean |
supportsLargeMessage()
ActiveMQ Artemis does support large messages
|
void |
xaCommit(Xid xid,
boolean onePhase) |
void |
xaEnd(Xid xid,
int flags) |
void |
xaFailed(Xid xid) |
void |
xaForget(Xid xid) |
int |
xaPrepare(Xid xid) |
void |
xaRollback(Xid xid,
boolean wasStarted) |
Xid[] |
xaScan() |
void |
xaStart(Xid xid,
int flags) |
getRemotingConnection, getSession, handleReceiveContinuation, handleReceiveLargeMessage, handleReceiveMessage, handleReceiveProducerCredits, handleReceiveProducerFailCredits, setSessionpublic ActiveMQSessionContext(String name, RemotingConnection remotingConnection, Channel sessionChannel, int serverVersion, int confirmationWindow)
protected Channel getSessionChannel()
protected String getName()
public void resetName(String name)
resetName in class SessionContextprotected int getConfirmationWindow()
public int getReconnectID()
getReconnectID in class SessionContextpublic boolean isKilled()
public void kill()
public void returnBlocking(org.apache.activemq.artemis.api.core.ActiveMQException cause)
SessionContextreturnBlocking in class SessionContextpublic void lockCommunications()
SessionContextlockCommunications in class SessionContextpublic void releaseCommunications()
releaseCommunications in class SessionContextpublic void cleanup()
cleanup in class SessionContextpublic void linkFlowControl(org.apache.activemq.artemis.api.core.SimpleString address,
ClientProducerCreditsImpl clientProducerCredits)
linkFlowControl in class SessionContextpublic void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
setSendAcknowledgementHandler in class SessionContextpublic void createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable)
throws org.apache.activemq.artemis.api.core.ActiveMQException
createSharedQueue in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void deleteQueue(org.apache.activemq.artemis.api.core.SimpleString queueName)
throws org.apache.activemq.artemis.api.core.ActiveMQException
deleteQueue in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic ClientSession.QueueQuery queueQuery(org.apache.activemq.artemis.api.core.SimpleString queueName) throws org.apache.activemq.artemis.api.core.ActiveMQException
queueQuery in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic boolean isWritable(ReadyListener callback)
isWritable in class SessionContextpublic ClientConsumerInternal createConsumer(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws org.apache.activemq.artemis.api.core.ActiveMQException
createConsumer in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int getServerVersion()
getServerVersion in class SessionContextpublic ClientSession.AddressQuery addressQuery(org.apache.activemq.artemis.api.core.SimpleString address) throws org.apache.activemq.artemis.api.core.ActiveMQException
addressQuery in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void closeConsumer(ClientConsumer consumer) throws org.apache.activemq.artemis.api.core.ActiveMQException
closeConsumer in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sendConsumerCredits(ClientConsumer consumer, int credits)
sendConsumerCredits in class SessionContextpublic void forceDelivery(ClientConsumer consumer, long sequence) throws org.apache.activemq.artemis.api.core.ActiveMQException
forceDelivery in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void simpleCommit()
throws org.apache.activemq.artemis.api.core.ActiveMQException
simpleCommit in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void simpleRollback(boolean lastMessageAsDelivered)
throws org.apache.activemq.artemis.api.core.ActiveMQException
SessionContextthis is because we only ACK after on the RA, We may review this if we always acked earlier.
simpleRollback in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sessionStart()
throws org.apache.activemq.artemis.api.core.ActiveMQException
sessionStart in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sessionStop()
throws org.apache.activemq.artemis.api.core.ActiveMQException
sessionStop in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void addSessionMetadata(String key, String data) throws org.apache.activemq.artemis.api.core.ActiveMQException
addSessionMetadata in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void addUniqueMetaData(String key, String data) throws org.apache.activemq.artemis.api.core.ActiveMQException
addUniqueMetaData in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void xaCommit(Xid xid, boolean onePhase) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
xaCommit in class SessionContextXAExceptionorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void xaEnd(Xid xid, int flags) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
xaEnd in class SessionContextXAExceptionorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sendProducerCreditsMessage(int credits,
org.apache.activemq.artemis.api.core.SimpleString address)
sendProducerCreditsMessage in class SessionContextpublic boolean supportsLargeMessage()
supportsLargeMessage in class SessionContextpublic int getCreditsOnSendingFull(MessageInternal msgI)
getCreditsOnSendingFull in class SessionContextpublic void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, org.apache.activemq.artemis.api.core.SimpleString defaultAddress) throws org.apache.activemq.artemis.api.core.ActiveMQException
sendFullMessage in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws org.apache.activemq.artemis.api.core.ActiveMQException
SessionContextsendInitialChunkOnLargeMessage in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws org.apache.activemq.artemis.api.core.ActiveMQException
sendLargeMessageChunk in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int sendServerLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws org.apache.activemq.artemis.api.core.ActiveMQException
sendServerLargeMessageChunk in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message)
throws org.apache.activemq.artemis.api.core.ActiveMQException
sendACK in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void expireMessage(ClientConsumer consumer, Message message) throws org.apache.activemq.artemis.api.core.ActiveMQException
expireMessage in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void sessionClose()
throws org.apache.activemq.artemis.api.core.ActiveMQException
sessionClose in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void xaForget(Xid xid) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
xaForget in class SessionContextXAExceptionorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int xaPrepare(Xid xid) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
xaPrepare in class SessionContextXAExceptionorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic Xid[] xaScan() throws org.apache.activemq.artemis.api.core.ActiveMQException
xaScan in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void xaRollback(Xid xid, boolean wasStarted) throws org.apache.activemq.artemis.api.core.ActiveMQException, XAException
xaRollback in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionXAExceptionpublic void xaStart(Xid xid, int flags) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
xaStart in class SessionContextXAExceptionorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic boolean configureTransactionTimeout(int seconds)
throws org.apache.activemq.artemis.api.core.ActiveMQException
configureTransactionTimeout in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int recoverSessionTimeout()
throws org.apache.activemq.artemis.api.core.ActiveMQException
SessionContextrecoverSessionTimeout in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
boolean temp)
throws org.apache.activemq.artemis.api.core.ActiveMQException
createQueue in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic boolean reattachOnNewConnection(RemotingConnection newConnection) throws org.apache.activemq.artemis.api.core.ActiveMQException
SessionContextreattachOnNewConnection in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws org.apache.activemq.artemis.api.core.ActiveMQException
recreateSession in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionprotected CreateSessionMessage newCreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge)
public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws org.apache.activemq.artemis.api.core.ActiveMQException
recreateConsumerOnServer in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void xaFailed(Xid xid) throws org.apache.activemq.artemis.api.core.ActiveMQException
xaFailed in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void restartSession()
throws org.apache.activemq.artemis.api.core.ActiveMQException
restartSession in class SessionContextorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void resetMetadata(HashMap<String,String> metaDataToSend)
resetMetadata in class SessionContextprotected void handleReceiveProducerCredits(SessionProducerCreditsMessage message)
protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message)
protected void handleReceiveSlowConsumerKillMessage(DisconnectConsumerWithKillMessage message)
protected ClassLoader lookupTCCL()
protected int calcWindowSize(int windowSize)
Copyright © 2023 The Apache Software Foundation. All rights reserved.