On 16 February 2010 15:38, Jean-Yves LEBLEU <jleb...@gmail.com> wrote: > Hi all, > > I am trying to use the failover transport > (failover:(tcp://localhost:61618)), and I have some questions : > > I did a test with a simple consumer in scala (see the code and log at > the end of the mail). > > Scenario : > Broker is stopped. > We start the consumer, it waits > Start the broker > Consumer connects and consume messages > Stop the broker and start the broker again > Consumer tries 6 times to reconnect and stop working.
I wonder if you have not restarted the broker in time for the client to reconnect? How long does the client take to reconnect and how long is the broker down for? Maybe you could try increasing the amount of time the failover transport waits before failing to connect... http://activemq.apache.org/failover-transport-reference.html e.g. try this URL failover:(tcp://localhost:61618)?maxReconnectAttempts=1000 BTW slightly more idiomatic Scala code for onMessage would be... def onMessage(message: Message): Unit = message match { case textMessage: TextMessage => println("Message recieved: " + textMessage.getText()) case _ => println("Oops, not a text message") } -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/