[ 
https://issues.apache.org/activemq/browse/CAMEL-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Strachan resolved CAMEL-1064.
-----------------------------------

    Resolution: Fixed

using *failover:tcp://localhost:61616* as the connection URL is the correct 
approach for dealing with reconnection to the broker in case of broker failure 
or network issues causing temporary socket loss.

in 5.2.0 or later of ActiveMQ the connection factory and ActiveMQ camel 
component use failover in the default URL by default to avoid folks having to 
know about the failover configuration. i.e. if you don't configure anything you 
will get failover and so auto-reconnection

> Camel ActiveMQ service not recovering from lost broker
> ------------------------------------------------------
>
>                 Key: CAMEL-1064
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1064
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-activemq
>    Affects Versions: 1.4.0, 1.5.0
>         Environment: Mac OS X (10.5), Java 1.5, ActiveMQ 5.1.0
>            Reporter: Christopher Hunt
>            Assignee: Hadrian Zbarcea
>            Priority: Critical
>         Attachments: CamelJmsToFileExample.java
>
>
> If the ActiveMQ broker is shut down and then started again while a Camel 
> ActiveMQ endpoint based program is listening on its queue, the program does 
> not pick the queue back up for consuming when ActiveMQ is back up. Anything 
> subsequently posted to the new broker becomes available only when the Camel 
> program is restarted.
> This is a problem in production style scenarios where the broker has to be 
> restarted for some reason e.g. so that modifications to its configuration can 
> be made.
> I have been able to observe the above behaviour with the 
> camel-example-jms-file project and attach a modified version of the 
> CamelJmsToFileExample.java file. My modifications bind to the broker at 
> tcp://localhost:61616 and cause the example to pause for 20s before sending 
> out any messages. In this time, if the broker (which has to be started 
> externally prior to executing the example) is shutdown and then started 
> again, no messages are received.
> Here are the actual recommended steps to reproduce the problem:
> 1. Start the ActiveMQ broker in one terminal window
> 2. Run the example via mvn compile exec:java
> 3. When the message displays stating that you have 20s, Ctrl-C the broker in 
> the broker terminal window
> 4. When the broker stops, start it again
> At this point no messages are displayed - you would expect them to be - they 
> have actually been sent out. This can be verified also:
> 5. Type mvn compile exec:java again
> 6. Let the example continue without interfering with the broker.
> You will now see the messages posted previously prior while the program waits 
> for 20 seconds (remember no messages have been posted at this point). Letting 
> the example continue demonstrates that after the 20 seconds, the messages are 
> sent out and then received quickly given that we have not touched the broker.
> The original thread posting can be found at:
> http://www.nabble.com/Camel-ActiveMQ-service-not-recovering-from-lost-broker-to20379163s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to