Class DefaultSenderController
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.proton.DefaultSenderController
- All Implemented Interfaces:
SenderController
The default
SenderController instance used by and sender context that is not assigned a custom controller.
This controller is extensible so that specialized sender controllers can be created from it.
The default controller works best with incoming AMQP clients and JMS over AMQP clients. For intra-broker connections it is likely that a custom sender controller would be a more appropriate option than using the default controller.
-
Nested Class Summary
Nested classes/interfaces inherited from interface SenderController
SenderController.RejectingOutgoingMessageWriter -
Field Summary
Fields inherited from interface SenderController
REJECTING_MESSAGE_WRITER -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSenderController(AMQPSessionContext session, org.apache.qpid.proton.engine.Sender protonSender, String clientId) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(boolean remoteClose) Handle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.protected SimpleStringgetMatchingQueue(SimpleString queueName, SimpleString address, RoutingType routingType, SimpleString filter, boolean matchFilter) org.apache.activemq.artemis.core.server.Consumerinit(ProtonServerSenderContext senderContext) Initialize sender controller state and handle open of AMQP sender resourcesselectOutgoingMessageWriter(ProtonServerSenderContext sender, org.apache.activemq.artemis.core.server.MessageReference reference) Controller selects a outgoing delivery writer that will handle the encoding and writing of the targetMessagecarried in the givenMessageReference.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SenderController
close
-
Constructor Details
-
DefaultSenderController
public DefaultSenderController(AMQPSessionContext session, org.apache.qpid.proton.engine.Sender protonSender, String clientId)
-
-
Method Details
-
init
public org.apache.activemq.artemis.core.server.Consumer init(ProtonServerSenderContext senderContext) throws Exception Description copied from interface:SenderControllerInitialize sender controller state and handle open of AMQP sender resources- Specified by:
initin interfaceSenderController- Parameters:
senderContext- The sender context that is requesting controller initialization.- Returns:
- a server consumer that has been initialize by the controller
- Throws:
Exception- if an error occurs during initialization.
-
close
Description copied from interface:SenderControllerHandle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.- Specified by:
closein interfaceSenderController- Parameters:
remoteClose- Indicates if the remote link detached the sender or local action closed it.- Throws:
Exception- if an error occurs during close.
-
selectOutgoingMessageWriter
public MessageWriter selectOutgoingMessageWriter(ProtonServerSenderContext sender, org.apache.activemq.artemis.core.server.MessageReference reference) Description copied from interface:SenderControllerController selects a outgoing delivery writer that will handle the encoding and writing of the targetMessagecarried in the givenMessageReference. The selection process should take into account how the message pre-processing will mutate the outgoing message.The default implementation performs no caching of writers and should be overridden in subclasses to reduce GC churn, the default version is suitable for tests.
- Specified by:
selectOutgoingMessageWriterin interfaceSenderController- Parameters:
sender- The server sender that will make use of the returned delivery context.reference- The message that must be sent using an outgoing context- Returns:
- an
MessageWriterto use when sending the message in the reference
-
getMatchingQueue
protected SimpleString getMatchingQueue(SimpleString queueName, SimpleString address, RoutingType routingType, SimpleString filter, boolean matchFilter) throws Exception - Throws:
Exception
-