Interface SessionCallback
public interface SessionCallback
-
Method Summary
Modifier and TypeMethodDescriptionvoidThis can be used to complete certain operations outside of the lock, like acks or other operations.voidbrowserFinished(org.apache.activemq.artemis.core.server.ServerConsumer consumer) Some protocols (Openwire) needs a special message with the browser is finished.default voidclose(boolean failed) voidclosed()voiddisconnect(org.apache.activemq.artemis.core.server.ServerConsumer consumerId, String errorMessage) default org.apache.activemq.artemis.core.transaction.TransactionbooleanhasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumerID) This one gives a chance for Proton to have its own flow control.default booleanhasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumerID, org.apache.activemq.artemis.core.server.MessageReference ref) This one includes the MessageReference for protocols like MQTT 5 (which only enforces flow control on durable messages (i.e.booleanisWritable(ReadyListener callback, Object protocolContext) intsendLargeMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumerID, long bodySize, int deliveryCount) intsendLargeMessageContinuation(org.apache.activemq.artemis.core.server.ServerConsumer consumerID, byte[] body, boolean continues, boolean requiresResponse) intsendMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumerID, int deliveryCount) voidsendProducerCreditsFailMessage(int credits, SimpleString address) voidsendProducerCreditsMessage(int credits, SimpleString address) default booleanA requirement to do direct delivery is: no extra locking required at the protocol layer.booleanupdateDeliveryCountAfterCancel(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.core.server.MessageReference ref, boolean failed) Use this to updates specifics on the message after a redelivery happened.
-
Method Details
-
supportsDirectDelivery
default boolean supportsDirectDelivery()A requirement to do direct delivery is: no extra locking required at the protocol layer. which cannot be guaranteed at AMQP as proton will need the locking. So, disable this on AMQP or any other protocol requiring extra lock. -
hasCredits
boolean hasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumerID) This one gives a chance for Proton to have its own flow control. -
hasCredits
default boolean hasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumerID, org.apache.activemq.artemis.core.server.MessageReference ref) This one includes the MessageReference for protocols like MQTT 5 (which only enforces flow control on durable messages (i.e. QoS 1 & 2)) -
afterDelivery
This can be used to complete certain operations outside of the lock, like acks or other operations.- Throws:
Exception
-
updateDeliveryCountAfterCancel
boolean updateDeliveryCountAfterCancel(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.core.server.MessageReference ref, boolean failed) Use this to updates specifics on the message after a redelivery happened. Return true if there was specific logic applied on the protocol, so the ServerConsumer won't make any adjustments. -
sendProducerCreditsMessage
-
sendProducerCreditsFailMessage
-
sendMessage
int sendMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumerID, int deliveryCount) -
sendLargeMessage
int sendLargeMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumerID, long bodySize, int deliveryCount) -
sendLargeMessageContinuation
int sendLargeMessageContinuation(org.apache.activemq.artemis.core.server.ServerConsumer consumerID, byte[] body, boolean continues, boolean requiresResponse) -
closed
void closed() -
disconnect
void disconnect(org.apache.activemq.artemis.core.server.ServerConsumer consumerId, String errorMessage) -
isWritable
-
browserFinished
void browserFinished(org.apache.activemq.artemis.core.server.ServerConsumer consumer) Some protocols (Openwire) needs a special message with the browser is finished. -
close
default void close(boolean failed) -
getCurrentTransaction
default org.apache.activemq.artemis.core.transaction.Transaction getCurrentTransaction()
-