activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From noone100 <>
Subject Transactional Message Lost On Failover
Date Wed, 04 Mar 2015 14:03:36 GMT

In a transacted session I try to receive a message again after a failover
using the failover protocol (see code below). The fail on the broker is
triggered using a Byteman script, which kills the jvm right after the method
org.apache.activemq.transaction.LocalTransaction.commit(). After failover a
JMSException is thrown which is catched and handled by the consumer. The
problem is, that the message is not resent due to the fact that it is
already removed and committed from the broker's database. Is there any
solution for that problem?

public void onMessage(Message msg) {
  try {
    System.out.println("count: " + counter.incrementAndGet() + ", received
message " + msg.toString());
    session.commit(); // let amq broker jvm die
    System.out.println("after commit"); //  won't happen
  } catch (JMSException e1) {
    System.out.println("undo changes");
    try {
    } catch (JMSException e) {

Thanks for your help!

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

View raw message