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(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) |
void |
createAddress(SimpleString address,
EnumSet<RoutingType> routingTypes,
boolean autoCreated) |
void |
createAddress(SimpleString address,
Set<RoutingType> routingTypes,
boolean autoCreated) |
ClientConsumerInternal |
createConsumer(SimpleString queueName,
SimpleString filterString,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated)
Deprecated.
|
void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated,
Boolean exclusive,
Boolean lastValue) |
void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
boolean autoCreated)
Deprecated.
|
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
RoutingType routingType,
SimpleString filterString,
boolean durable) |
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
RoutingType routingType,
SimpleString filterString,
boolean durable,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Creates a shared queue using the routing type set by the Address.
|
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable) |
void |
deleteQueue(SimpleString queueName) |
void |
expireMessage(ClientConsumer consumer,
Message message) |
void |
forceDelivery(ClientConsumer consumer,
long sequence) |
protected int |
getConfirmationWindow() |
int |
getCreditsOnSendingFull(Message 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(SimpleString address,
ClientProducerCredits 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(SimpleString queueName) |
boolean |
reattachOnNewConnection(RemotingConnection newConnection)
it will either 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,
long consumerId,
boolean isSessionStarted) |
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(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(ICoreMessage msgI,
boolean sendBlocking,
SendAcknowledgementHandler handler,
SimpleString defaultAddress) |
int |
sendInitialChunkOnLargeMessage(Message msgI)
it should return the number of credits (or bytes) used to send this packet
|
int |
sendLargeMessageChunk(Message msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
int reconnectID,
SendAcknowledgementHandler messageHandler) |
void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
int |
sendServerLargeMessageChunk(Message msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
SendAcknowledgementHandler messageHandler) |
void |
sessionClose() |
void |
sessionStart() |
void |
sessionStop() |
void |
setSendAcknowledgementHandler(SendAcknowledgementHandler handler) |
void |
simpleCommit() |
void |
simpleCommit(boolean block) |
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, setSession
public 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 SessionContext
protected int getConfirmationWindow()
public int getReconnectID()
getReconnectID
in class SessionContext
public boolean isKilled()
public void kill()
public void returnBlocking(ActiveMQException cause)
SessionContext
returnBlocking
in class SessionContext
public void lockCommunications()
SessionContext
lockCommunications
in class SessionContext
public void releaseCommunications()
releaseCommunications
in class SessionContext
public void cleanup()
cleanup
in class SessionContext
public void linkFlowControl(SimpleString address, ClientProducerCredits clientProducerCredits)
linkFlowControl
in class SessionContext
public void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
setSendAcknowledgementHandler
in class SessionContext
public void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
SessionContext
createSharedQueue
in class SessionContext
ActiveMQException
public void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable) throws ActiveMQException
createSharedQueue
in class SessionContext
ActiveMQException
public void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
createSharedQueue
in class SessionContext
ActiveMQException
public void deleteQueue(SimpleString queueName) throws ActiveMQException
deleteQueue
in class SessionContext
ActiveMQException
public ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
queueQuery
in class SessionContext
ActiveMQException
public boolean isWritable(ReadyListener callback)
isWritable
in class SessionContext
public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException
createConsumer
in class SessionContext
ActiveMQException
public int getServerVersion()
getServerVersion
in class SessionContext
public ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
addressQuery
in class SessionContext
ActiveMQException
public void closeConsumer(ClientConsumer consumer) throws ActiveMQException
closeConsumer
in class SessionContext
ActiveMQException
public void sendConsumerCredits(ClientConsumer consumer, int credits)
sendConsumerCredits
in class SessionContext
public void forceDelivery(ClientConsumer consumer, long sequence) throws ActiveMQException
forceDelivery
in class SessionContext
ActiveMQException
public void simpleCommit() throws ActiveMQException
simpleCommit
in class SessionContext
ActiveMQException
public void simpleCommit(boolean block) throws ActiveMQException
simpleCommit
in class SessionContext
ActiveMQException
public void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
SessionContext
this is because we only ACK after on the RA, We may review this if we always acked earlier.
simpleRollback
in class SessionContext
ActiveMQException
public void sessionStart() throws ActiveMQException
sessionStart
in class SessionContext
ActiveMQException
public void sessionStop() throws ActiveMQException
sessionStop
in class SessionContext
ActiveMQException
public void addSessionMetadata(String key, String data) throws ActiveMQException
addSessionMetadata
in class SessionContext
ActiveMQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
addUniqueMetaData
in class SessionContext
ActiveMQException
public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
xaCommit
in class SessionContext
XAException
ActiveMQException
public void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
xaEnd
in class SessionContext
XAException
ActiveMQException
public void sendProducerCreditsMessage(int credits, SimpleString address)
sendProducerCreditsMessage
in class SessionContext
public boolean supportsLargeMessage()
supportsLargeMessage
in class SessionContext
public int getCreditsOnSendingFull(Message msgI)
getCreditsOnSendingFull
in class SessionContext
public void sendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
sendFullMessage
in class SessionContext
ActiveMQException
public int sendInitialChunkOnLargeMessage(Message msgI) throws ActiveMQException
SessionContext
sendInitialChunkOnLargeMessage
in class SessionContext
ActiveMQException
public int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
sendLargeMessageChunk
in class SessionContext
ActiveMQException
public int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
sendServerLargeMessageChunk
in class SessionContext
ActiveMQException
public void sendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) throws ActiveMQException
sendACK
in class SessionContext
ActiveMQException
public void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException
expireMessage
in class SessionContext
ActiveMQException
public void sessionClose() throws ActiveMQException
sessionClose
in class SessionContext
ActiveMQException
public void xaForget(Xid xid) throws XAException, ActiveMQException
xaForget
in class SessionContext
XAException
ActiveMQException
public int xaPrepare(Xid xid) throws XAException, ActiveMQException
xaPrepare
in class SessionContext
XAException
ActiveMQException
public Xid[] xaScan() throws ActiveMQException
xaScan
in class SessionContext
ActiveMQException
public void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
xaRollback
in class SessionContext
ActiveMQException
XAException
public void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
xaStart
in class SessionContext
XAException
ActiveMQException
public boolean configureTransactionTimeout(int seconds) throws ActiveMQException
configureTransactionTimeout
in class SessionContext
ActiveMQException
public int recoverSessionTimeout() throws ActiveMQException
SessionContext
recoverSessionTimeout
in class SessionContext
ActiveMQException
public void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
createAddress
in class SessionContext
ActiveMQException
public void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
createAddress
in class SessionContext
ActiveMQException
@Deprecated public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) throws ActiveMQException
createQueue
in class SessionContext
ActiveMQException
public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastValue) throws ActiveMQException
createQueue
in class SessionContext
ActiveMQException
@Deprecated public void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) throws ActiveMQException
createQueue
in class SessionContext
ActiveMQException
public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
SessionContext
reattachOnNewConnection
in class SessionContext
ActiveMQException
public void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException
recreateSession
in class SessionContext
ActiveMQException
protected CreateSessionMessage newCreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge)
public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) throws ActiveMQException
recreateConsumerOnServer
in class SessionContext
ActiveMQException
public void xaFailed(Xid xid) throws ActiveMQException
xaFailed
in class SessionContext
ActiveMQException
public void restartSession() throws ActiveMQException
restartSession
in class SessionContext
ActiveMQException
public void resetMetadata(HashMap<String,String> metaDataToSend)
resetMetadata
in class SessionContext
protected void handleReceiveProducerCredits(SessionProducerCreditsMessage message)
protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message)
protected void handleReceiveSlowConsumerKillMessage(DisconnectConsumerWithKillMessage message)
protected ClassLoader lookupTCCL()
protected int calcWindowSize(int windowSize)
Copyright © 2018 JBoss by Red Hat. All rights reserved.