Package org.apache.activemq.broker.util
Class RedeliveryPlugin
java.lang.Object
org.apache.activemq.broker.BrokerFilter
org.apache.activemq.broker.MutableBrokerFilter
org.apache.activemq.broker.BrokerPluginSupport
org.apache.activemq.broker.util.RedeliveryPlugin
- All Implemented Interfaces:
Broker,BrokerPlugin,Region,org.apache.activemq.Service
Replace regular DLQ handling with redelivery via a resend to the original destination
after a delay
A destination matching RedeliveryPolicy controls the quantity and delay for re-sends
If there is no matching policy or an existing policy limit is exceeded by default
regular DLQ processing resumes. This is controlled via sendToDlqIfMaxRetriesExceeded
and fallbackToDeadLetter
-
Field Summary
FieldsFields inherited from class org.apache.activemq.broker.MutableBrokerFilter
next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.activemq.broker.region.policy.RedeliveryPolicyMapinstallPlugin(Broker broker) Installs the plugin into the interceptor chain of the broker, returning the new intercepted broker to use.booleanbooleanbooleansendToDeadLetterQueue(ConnectionContext context, org.apache.activemq.broker.region.MessageReference messageReference, Subscription subscription, Throwable poisonCause) A message needs to go to the DLQvoidsetFallbackToDeadLetter(boolean fallbackToDeadLetter) What to do if there is no matching redelivery policy for a destination.voidsetRedeliveryPolicyMap(org.apache.activemq.broker.region.policy.RedeliveryPolicyMap redeliveryPolicyMap) voidsetSendToDlqIfMaxRetriesExceeded(boolean sendToDlqIfMaxRetriesExceeded) What to do if the maxretries on a matching redelivery policy is exceeded.Methods inherited from class org.apache.activemq.broker.BrokerPluginSupport
start, stopMethods inherited from class org.apache.activemq.broker.MutableBrokerFilter
getAdaptor, getNext, setNextMethods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addConnection, addConsumer, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageDispatched, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConnection, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, send, setAdminConnectionContext, slowConsumer, virtualDestinationAdded, virtualDestinationRemoved
-
Field Details
-
REDELIVERY_DELAY
- See Also:
-
-
Constructor Details
-
RedeliveryPlugin
public RedeliveryPlugin()
-
-
Method Details
-
installPlugin
Description copied from interface:BrokerPluginInstalls the plugin into the interceptor chain of the broker, returning the new intercepted broker to use.- Specified by:
installPluginin interfaceBrokerPlugin- Overrides:
installPluginin classBrokerPluginSupport- Throws:
Exception
-
getRedeliveryPolicyMap
public org.apache.activemq.broker.region.policy.RedeliveryPolicyMap getRedeliveryPolicyMap() -
setRedeliveryPolicyMap
public void setRedeliveryPolicyMap(org.apache.activemq.broker.region.policy.RedeliveryPolicyMap redeliveryPolicyMap) -
isSendToDlqIfMaxRetriesExceeded
public boolean isSendToDlqIfMaxRetriesExceeded() -
setSendToDlqIfMaxRetriesExceeded
public void setSendToDlqIfMaxRetriesExceeded(boolean sendToDlqIfMaxRetriesExceeded) What to do if the maxretries on a matching redelivery policy is exceeded. when true, the region broker DLQ processing will be used via sendToDeadLetterQueue when false, there is no action- Parameters:
sendToDlqIfMaxRetriesExceeded-
-
isFallbackToDeadLetter
public boolean isFallbackToDeadLetter() -
setFallbackToDeadLetter
public void setFallbackToDeadLetter(boolean fallbackToDeadLetter) What to do if there is no matching redelivery policy for a destination. when true, the region broker DLQ processing will be used via sendToDeadLetterQueue when false, there is no action- Parameters:
fallbackToDeadLetter-
-
sendToDeadLetterQueue
public boolean sendToDeadLetterQueue(ConnectionContext context, org.apache.activemq.broker.region.MessageReference messageReference, Subscription subscription, Throwable poisonCause) Description copied from interface:BrokerA message needs to go to the DLQ- Specified by:
sendToDeadLetterQueuein interfaceBroker- Overrides:
sendToDeadLetterQueuein classBrokerFilter- Parameters:
context- connection contextmessageReference- message referencepoisonCause- reason for dlq submission, may be null- Returns:
- true if Message was placed in a DLQ false if discarded.
-