Class AMQPFederationAddressConsumer.AMQPFederatedAddressDeliveryHandler
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
org.apache.activemq.artemis.protocol.amqp.proton.ProtonAbstractReceiver
org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerReceiverContext
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressConsumer.AMQPFederatedAddressDeliveryHandler
- All Implemented Interfaces:
ProtonDeliveryHandler
- Enclosing class:
AMQPFederationAddressConsumer
protected abstract class AMQPFederationAddressConsumer.AMQPFederatedAddressDeliveryHandler
extends ProtonServerReceiverContext
Wrapper around the standard receiver context that provides federation specific entry points and customizes inbound
delivery handling for this Address receiver.
-
Nested Class Summary
Nested classes/interfaces inherited from class ProtonAbstractReceiver
ProtonAbstractReceiver.FlowControlRunner, ProtonAbstractReceiver.ReceiverState -
Field Summary
FieldsFields inherited from class ProtonServerReceiverContext
address, addressAlreadyClashed, explicitRoutingType, implicitRoutingType, lastAddress, lastAddressPolicyFields inherited from class ProtonAbstractReceiver
connection, coreLargeMessageReader, coreMessageReader, coreTunnelingEnabled, creditRunnable, creditTopUpRunner, drainCreditOnNoSpace, drainTimeout, largeMessageReader, messageReader, minLargeMessageSize, pendingQuiesceTimeout, pendingSettles, pendingStop, protonSession, receiver, routingContext, sessionSPI, standardMessageReader, state, useModifiedFields inherited from class ProtonInitializable
initialized -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidactualDelivery(Message message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx) Perform the actual message processing for an inbound message.final voidclose(boolean remoteLinkClose) protected final RunnablecreateCreditRunnable(AMQPConnectionContext connection) Subclass can override this to provide a custom credit runnable that performs other checks or applies credit in a manner more fitting that implementation.protected final intSubclass can override this to provide the minimum large message size that should be used when creating receiver instances.protected intgetLinkQuiesceTimeout(AMQPConnectionContext connection) Gets the time in milliseconds that the receiver should wait before it considers a link quiesce attempt to have failed and act to close the link with an error, this allows subclass implementations to override the defaults set on the connection level.final voidprotected booleanShould the receiver drain link credit when a transient delivery error occurs, this allows subclass implementations to override the defaults set on the connection level.protected booleanShould the receiver send an AMQP Modified disposition with delivery failed set to true for address full errors instead of the Rejected disposition it would by default.protected abstract voidrouteFederatedMessage(Message message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx) Route the inbound message to the intended target address bindings.Methods inherited from class ProtonServerReceiverContext
deduceRoutingType, getAddressInUse, getExplicitRoutingType, getExplicitRoutingType, getImplicitRoutingType, getImplicitRoutingType, getPreferredRoutingType, isAnonymousRelayMethods inherited from class ProtonAbstractReceiver
calculatedUpdateRefill, close, closeCurrentReader, createCreditRunnable, deliveryFailed, doCreditTopUpRun, enableCoreTunneling, failIfCoreTunnelNotEnabled, getConnection, getEffectiveDefaultOutcome, getSessionContext, incrementSettle, isAddressFull, isBellowThreshold, isBusy, isClosed, isDraining, isStarted, isStopped, isStopping, onExceptionWhileReading, onFlow, onMessage, onMessageComplete, outcomeSupported, recoverContext, settle, start, stop, topUpCreditIfNeeded, trySelectMessageReaderMethods inherited from class ProtonInitializable
isInitialized
-
Field Details
-
cachedAddress
-
closed
protected boolean closed
-
-
Method Details
-
close
- Specified by:
closein interfaceProtonDeliveryHandler- Overrides:
closein classProtonServerReceiverContext- Throws:
ActiveMQAMQPException
-
isUseModifiedForTransientDeliveryErrors
Description copied from class:ProtonAbstractReceiverShould the receiver send an AMQP Modified disposition with delivery failed set to true for address full errors instead of the Rejected disposition it would by default.- Overrides:
isUseModifiedForTransientDeliveryErrorsin classProtonAbstractReceiver- Parameters:
connection- The connection context that this receiver instance is bound to- Returns:
trueif the receiver send a modified outcome and false for rejected outcomes.
-
isDrainOnTransientDeliveryErrors
Description copied from class:ProtonAbstractReceiverShould the receiver drain link credit when a transient delivery error occurs, this allows subclass implementations to override the defaults set on the connection level.- Overrides:
isDrainOnTransientDeliveryErrorsin classProtonAbstractReceiver- Parameters:
connection- The connection context that this receiver instance is bound to- Returns:
- true if transient delivery errors should be handled by draining link credit from the remote sender.
-
getLinkQuiesceTimeout
Description copied from class:ProtonAbstractReceiverGets the time in milliseconds that the receiver should wait before it considers a link quiesce attempt to have failed and act to close the link with an error, this allows subclass implementations to override the defaults set on the connection level.- Overrides:
getLinkQuiesceTimeoutin classProtonAbstractReceiver- Parameters:
connection- The connection context that this receiver instance is bound to- Returns:
- the time in milliseconds to wait for remote sender once a link quiesce is initiated by this peer.
-
createCreditRunnable
Description copied from class:ProtonAbstractReceiverSubclass can override this to provide a custom credit runnable that performs other checks or applies credit in a manner more fitting that implementation.- Overrides:
createCreditRunnablein classProtonAbstractReceiver- Parameters:
connection- TheAMQPConnectionContextthat this resource falls under.- Returns:
- a
Runnablethat will perform the actual credit granting operation
-
getConfiguredMinLargeMessageSize
Description copied from class:ProtonAbstractReceiverSubclass can override this to provide the minimum large message size that should be used when creating receiver instances.- Overrides:
getConfiguredMinLargeMessageSizein classProtonAbstractReceiver- Parameters:
connection- TheAMQPConnectionContextthat this resource falls under.- Returns:
- the minimum large message size configuration value for this receiver
-
initialize
- Overrides:
initializein classProtonServerReceiverContext- Throws:
Exception
-
actualDelivery
protected final void actualDelivery(Message message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.amqp.messaging.DeliveryAnnotations deliveryAnnotations, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx) Description copied from class:ProtonAbstractReceiverPerform the actual message processing for an inbound message. The subclass either consumes and settles the message in place or hands it off to another intermediary who is responsible for eventually settling the newly read message.- Overrides:
actualDeliveryin classProtonServerReceiverContext- Parameters:
message- The message as provided from the remote or after local transformation by subclass.delivery- The proton delivery where the message bytes where read fromdeliveryAnnotations- The delivery annotations if present that accompanied the incoming message.receiver- The proton receiver that represents the link over which the message was sent.tx- The transaction under which the incoming message was sent.
-
routeFederatedMessage
protected abstract void routeFederatedMessage(Message message, org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.engine.Receiver receiver, org.apache.activemq.artemis.core.transaction.Transaction tx) throws Exception Route the inbound message to the intended target address bindings.- Parameters:
message- The received message after transform and hops count updates.delivery- TheDeliverythat the message arrived inreceiver- TheReceiverthat represents the consumer link.tx- The active transaction this message arrived within.- Throws:
Exception- if an error occurs routing the message.
-