maybe try and build a junit test case and drive the xa transaction
completion via code, see
org.apache.activemq.broker.XARecoveryBrokerTest  for an example and
combine it with org.apache.activemq.broker.BrokerRedeliveryTest from
activemq-unit-tests

Note, the broker redelivery resends the message to the original
destination, so it should get consumed again in a different xa
transaction.


On 15 April 2013 15:11,  <[email protected]> wrote:
> Hello,
>
> I'm having some troubles using redelivery plugin and XA transactions. I'm 
> using a spring listener-container and JtaTransactionManager in an application 
> server. I'm using ActiveMQ 5.8.0.
>
> When the listener receives the message, we write it into a database and send 
> a response message during the transaction. In order to test the rollback of 
> the transaction, we throw an exception before the end of transaction.
>
> When using client redelivery (jms.redeliveryPolicy.maximumRedeliveries=3), 
> everything works as expected: the response message is not sent and the 
> message is not persisted.
>
> But when using broker redelivery plugin, the behavior is different. After the 
> redelivery delay, the message is sent again but the XA is not working anymore 
> on the messaging side: the response message is sent anyway. So after sending 
> 1 message,  I end up with 1 message in my dead letter queue (expected), an 
> empty database (expected), and various duplicate message responses (should be 
> 0).
>
> This is my configuration of the redelivery plugin :
> <plugins>
>    <redeliveryPlugin fallbackToDeadLetter="true" 
> sendToDlqIfMaxRetriesExceeded="true">
>      <redeliveryPolicyMap>
>        <redeliveryPolicyMap>
>          <defaultEntry>
>            <redeliveryPolicy maximumRedeliveries="6" redeliveryDelay="10000" 
> />
>          </defaultEntry>
>        </redeliveryPolicyMap>
>      </redeliveryPolicyMap>
>    </redeliveryPlugin>
> </plugins>
>
> Has anyone experienced similar problems ? Am I missing something about broker 
> redelivery ?
>
> Thank you,
> Guillaume
>
> _________________________________________________________________________________________________________________________
>
> Ce message et ses pieces jointes peuvent contenir des informations 
> confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu 
> ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
> electroniques etant susceptibles d'alteration,
> France Telecom - Orange decline toute responsabilite si ce message a ete 
> altere, deforme ou falsifie. Merci.
>
> This message and its attachments may contain confidential or privileged 
> information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete 
> this message and its attachments.
> As emails may be altered, France Telecom - Orange is not liable for messages 
> that have been modified, changed or falsified.
> Thank you.
>



-- 
http://redhat.com
http://blog.garytully.com

Reply via email to