activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ayache <aya...@zotix.co>
Subject AMQ transaction rollback and commit
Date Mon, 06 Mar 2017 17:37:48 GMT
Hi 

I have written AMQ plugin - see bellow a snippet. I am overriding the send
and messageConsumed methods. Whenever a message is consumed the client will
either send a commit for successfully downloading the message or rollback
when it is failed. The messageConsumed gets invoked for either case and for
each case there is some logic needs to be run. Is there a way of finding out
from the context or MessageReference whether the client has committed the
transaction or rolled back? 

Thanks 

Ayache 


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

   private AuditWriter auditor; 

    @Override 
    public void send(final ProducerBrokerExchange producerExchange, final
Message message) throws Exception { 
      //some logic.... 
      
     // call super 
      super.send(producerExchange, message); 
            
    } 


    @Override 
    public void messageConsumed(final ConnectionContext context, final
MessageReference messageReference)  { 
       // some logic.... 

        getNext().messageConsumed(context, messageReference); 
    } 

 } 



--
View this message in context: http://activemq.2283324.n4.nabble.com/AMQ-transaction-rollback-and-commit-tp4723058.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message