activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mserrano <mar...@attivio.com>
Subject Re: messages sometimes lost during pure master/slave failover
Date Fri, 03 Jun 2011 14:55:09 GMT
We are using the ActiveMQ in an embedded mode in our application.  It may be
difficult to reproduce in a test case because of the intermittent nature...

On inspection of the code below (from MasterBroker.java), it seems that an
exception syncing to the slave is logged but otherwise ignored.  Doesn't
this allow the send to return to the client successfully even if the sync
didn't occur?  This seems like a bad thing.


  /**
   * @param context
   * @param message
   * @throws Exception
   */
  @Override
  public void send(ProducerBrokerExchange producerExchange, Message message)
throws Exception {
    /**
     * A message can be dispatched before the super.send() method returns so
-
     * here the order is switched to avoid problems on the slave with
     * receiving acks for messages not received yet
     */
    sendSyncToSlave(message);
    super.send(producerExchange, message);
  }

...

    protected void sendSyncToSlave(Command command) {
        try {
            Response response = (Response)slave.request(command);
            if (response.isException()) {
                ExceptionResponse er = (ExceptionResponse)response;
                LOG.error("Slave Failed", er.getException());
            }
        } catch (Throwable e) {
            LOG.error("Slave Failed", e);
        }
    }




--
View this message in context: http://activemq.2283324.n4.nabble.com/messages-sometimes-lost-during-pure-master-slave-failover-tp3570898p3571086.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message