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, 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(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(SimpleString address, ClientProducerCredits clientProducerCredits)
linkFlowControl in class SessionContextpublic void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
setSendAcknowledgementHandler in class SessionContextpublic void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
SessionContextcreateSharedQueue in class SessionContextActiveMQExceptionpublic void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable) throws ActiveMQException
createSharedQueue in class SessionContextActiveMQExceptionpublic void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
createSharedQueue in class SessionContextActiveMQExceptionpublic void deleteQueue(SimpleString queueName) throws ActiveMQException
deleteQueue in class SessionContextActiveMQExceptionpublic ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
queueQuery in class SessionContextActiveMQExceptionpublic boolean isWritable(ReadyListener callback)
isWritable in class SessionContextpublic ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException
createConsumer in class SessionContextActiveMQExceptionpublic int getServerVersion()
getServerVersion in class SessionContextpublic ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
addressQuery in class SessionContextActiveMQExceptionpublic void closeConsumer(ClientConsumer consumer) throws ActiveMQException
closeConsumer in class SessionContextActiveMQExceptionpublic void sendConsumerCredits(ClientConsumer consumer, int credits)
sendConsumerCredits in class SessionContextpublic void forceDelivery(ClientConsumer consumer, long sequence) throws ActiveMQException
forceDelivery in class SessionContextActiveMQExceptionpublic void simpleCommit()
throws ActiveMQException
simpleCommit in class SessionContextActiveMQExceptionpublic void simpleCommit(boolean block)
throws ActiveMQException
simpleCommit in class SessionContextActiveMQExceptionpublic void simpleRollback(boolean lastMessageAsDelivered)
throws ActiveMQException
SessionContextthis is because we only ACK after on the RA, We may review this if we always acked earlier.
simpleRollback in class SessionContextActiveMQExceptionpublic void sessionStart()
throws ActiveMQException
sessionStart in class SessionContextActiveMQExceptionpublic void sessionStop()
throws ActiveMQException
sessionStop in class SessionContextActiveMQExceptionpublic void addSessionMetadata(String key, String data) throws ActiveMQException
addSessionMetadata in class SessionContextActiveMQExceptionpublic void addUniqueMetaData(String key, String data) throws ActiveMQException
addUniqueMetaData in class SessionContextActiveMQExceptionpublic void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
xaCommit in class SessionContextXAExceptionActiveMQExceptionpublic void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
xaEnd in class SessionContextXAExceptionActiveMQExceptionpublic void sendProducerCreditsMessage(int credits,
SimpleString address)
sendProducerCreditsMessage in class SessionContextpublic boolean supportsLargeMessage()
supportsLargeMessage in class SessionContextpublic int getCreditsOnSendingFull(Message msgI)
getCreditsOnSendingFull in class SessionContextpublic void sendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
sendFullMessage in class SessionContextActiveMQExceptionpublic int sendInitialChunkOnLargeMessage(Message msgI) throws ActiveMQException
SessionContextsendInitialChunkOnLargeMessage in class SessionContextActiveMQExceptionpublic int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
sendLargeMessageChunk in class SessionContextActiveMQExceptionpublic int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
sendServerLargeMessageChunk in class SessionContextActiveMQExceptionpublic void sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message)
throws ActiveMQException
sendACK in class SessionContextActiveMQExceptionpublic void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException
expireMessage in class SessionContextActiveMQExceptionpublic void sessionClose()
throws ActiveMQException
sessionClose in class SessionContextActiveMQExceptionpublic void xaForget(Xid xid) throws XAException, ActiveMQException
xaForget in class SessionContextXAExceptionActiveMQExceptionpublic int xaPrepare(Xid xid) throws XAException, ActiveMQException
xaPrepare in class SessionContextXAExceptionActiveMQExceptionpublic Xid[] xaScan() throws ActiveMQException
xaScan in class SessionContextActiveMQExceptionpublic void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
xaRollback in class SessionContextActiveMQExceptionXAExceptionpublic void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
xaStart in class SessionContextXAExceptionActiveMQExceptionpublic boolean configureTransactionTimeout(int seconds)
throws ActiveMQException
configureTransactionTimeout in class SessionContextActiveMQExceptionpublic int recoverSessionTimeout()
throws ActiveMQException
SessionContextrecoverSessionTimeout in class SessionContextActiveMQExceptionpublic void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
createAddress in class SessionContextActiveMQExceptionpublic void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
createAddress in class SessionContextActiveMQException@Deprecated public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) throws ActiveMQException
createQueue in class SessionContextActiveMQExceptionpublic 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 SessionContextActiveMQException@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 SessionContextActiveMQExceptionpublic boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
SessionContextreattachOnNewConnection in class SessionContextActiveMQExceptionpublic void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException
recreateSession in class SessionContextActiveMQExceptionprotected 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 SessionContextActiveMQExceptionpublic void xaFailed(Xid xid) throws ActiveMQException
xaFailed in class SessionContextActiveMQExceptionpublic void restartSession()
throws ActiveMQException
restartSession in class SessionContextActiveMQExceptionpublic 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 © 2019 JBoss by Red Hat. All rights reserved.