Interface MessageInterceptorStrategy
- All Known Implementing Classes:
ChainMessageInterceptorStrategy,HeaderMessageInterceptorStrategy
public interface MessageInterceptorStrategy
-
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(ProducerBrokerExchange producerBrokerExchange, org.apache.activemq.command.Message message) When a PolicyEntry is configured with a MessageInterceptorStrategy, the process method is invoked with the current ProducerBrokerExchange and Message before the message is stored in any destination cache or persistence store.
-
Method Details
-
process
void process(ProducerBrokerExchange producerBrokerExchange, org.apache.activemq.command.Message message) throws jakarta.jms.MessageFormatRuntimeException When a PolicyEntry is configured with a MessageInterceptorStrategy, the process method is invoked with the current ProducerBrokerExchange and Message before the message is stored in any destination cache or persistence store. Implementations may reference data from the ProducerBrokerExchange and may check or modify headers, properties, body or other metadata on the Message. Any change to the message must adhere to OpenWire and ActiveMQ requirements or risk issues with memory usage, compatibility, and general correct functioning. Implementations shall not copy, or clone the message. Implementations may throw a MessageFormatRuntimeException that is returned to the client to indicate a message should not be added to the queue.- Parameters:
producerBrokerExchange-message-- Throws:
jakarta.jms.MessageFormatRuntimeException
-