activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akhettar <>
Subject Message Ack and Original Request correlation.
Date Tue, 16 Feb 2016 14:18:27 GMT

I have written a plugin (public final class MessageAuditorPlugin extends
BrokerPluginSupport). I audit the incoming message before sending to a queue
(override the send() method) and I have also overridden the acknowledge()
method - see code snippet below. The client is set to Auto Acknowledgement
mode. So as soon as the client consume the response and acknowledgement is
automatically sent to the broker and get's picked in the override method
below acknowledge(ConsumerBrokerExchange consumerExchange, final MessageAck
I am looking for a way of correlating the original request to the
Bear in mind the MessageAck doesn't contain a direct correlation Id to the
original request. It does have MessageId which is slightly different to that
the original Request - see below pattern. I could use the below pattern to
correlate request and acknowledgement but not sure if this is the best way?

Any direction is really appreciated.



*Message Id pattern*

*First Request:*

Request MessageId: ID:akhettar-58632-1455191246966-5:11:-1:1:1
Acknowledgement MessageId: ID:akhettar-58632-1455191246966-5:11:-1:1

*Second Request:*
Request MessageId: ID:akhettar-58632-1455191246966-5:11:-1:1:2
Acknowledgement MessageId: ID:akhettar-58632-1455191246966-5:11:-1:2

*Code Snippet*

 * Message AuditWriter Interceptor. It audits message into Cassandra
public final class MessageAuditorPluginNew extends BrokerPluginSupport {

    public void send(final ProducerBrokerExchange producerExchange, final
Message message) throws Exception {
        // audit the message
        super.send(producerExchange, message);

    public void acknowledge(final ConsumerBrokerExchange consumerExchange,
final MessageAck ack) throws Exception {
        // handle acknowledgment
        getNext().acknowledge(consumerExchange, ack);


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message