On Mon, Jul 11, 2011 at 10:51 AM, Sander Mak <sander...@gmail.com> wrote: > Not really during startup, since the app keeps running fine as longs > as the ActiveMQ broker is running. Only when I purposely kill the > broker, the Camel app goes down with it. It almost seems like a > System.exit(0) is happening somewhere in the ActiveMQ code which > handles the loss of connection. Although I find that hard to > believe... >
How do you shutdown the AMQ broker? And why do you want to shutdown the broker, but keep on running Camel? > > On Mon, Jul 11, 2011 at 10:34 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: >> On Mon, Jul 11, 2011 at 10:09 AM, Sander Mak <sander...@gmail.com> wrote: >>> Hi Claus, >>> >>> Thanks for chiming in. I followed your advice and used Main: >>> http://pastie.org/2195549 >>> >>> Unfortunately the same thing happens: the JVM shutsdown once I >>> shutdown ActiveMQ. The interesting bit is that the Hangup code >>> (shutdown hook) is triggered by this scenario: >>> >>> 09:58:08,657 [ INFO] MainSupport$HangupInterceptor:74 - Received hang >>> up - stopping the main instance. >>> >>> (for completeness sake, the full output is here: http://pastie.org/2195573 ) >>> >>> This is ultimately what causes the app stop, without any attempt at >>> recovery. Obviously I didn't do ctrl-c on the Camel app or anything >>> else that might cause this. I observed the same behavior in my >>> original application (where I had my own shutdownhook as well, which >>> was triggered). Strange huh? >> >> Maybe some exception/failure occurs on startup and the JVM is terminated. >> >> >>> >>> >>> >>> On Wed, Jul 6, 2011 at 8:13 PM, Claus Ibsen <claus.ib...@gmail.com> wrote: >>>> Hi >>>> >>>> See this example how to keep a standalone Camel app running >>>> http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html >>>> >>>> Also chapter 13 in the Camel in Action book talks about running Camel >>>> standalone. >>>> >>>> On Wed, Jul 6, 2011 at 4:39 PM, Sander Mak <sander...@gmail.com> wrote: >>>>> Gentle bump, since this is driving me up the wall... On a lost >>>>> connection to ActiveMQ, I somehow can't recover gracefully from an AMQ >>>>> exception that is logged at debug level but never presented to any of >>>>> the errorhandlers. Would be great if somebody else could verify this >>>>> behavior or shed some light on what I might be doing wrong. >>>>> >>>>> Thanks! >>>>> Sander >>>>> >>>>> On Tue, Jul 5, 2011 at 8:39 AM, Sander Mak <sander...@gmail.com> wrote: >>>>>> I just added every bit of exception handling that I could think of to >>>>>> the example: http://pastebin.com/s9nHMihT >>>>>> >>>>>> None of these are triggered by this exception (no additional logging >>>>>> as specified), the program terminates with exact the same output. What >>>>>> am I doing wrong? >>>>>> >>>>>> >>>>>> Thanks, >>>>>> Sander >>>>>> >>>>>> On Tue, Jul 5, 2011 at 7:03 AM, Sander Mak <sander...@gmail.com> wrote: >>>>>>> Thanks, >>>>>>> >>>>>>> I must add that on the application that I encountered this on I do >>>>>>> have an errorHandler defined. Will have to play a bit with it to find >>>>>>> out why the exception is not caught then. Since the exception is >>>>>>> logged at debug level I was under the impression that it is already >>>>>>> handled by AMQ or Camel. >>>>>>> >>>>>>> Sander >>>>>>> >>>>>>> On Mon, Jul 4, 2011 at 10:05 PM, Ashwin Karpe <aka...@fusesource.com> >>>>>>> wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> It is quite straightforward. When the ActiveMQ broker is down a >>>>>>>> connection >>>>>>>> cannot be created to the broker. If one already exists, the connection >>>>>>>> becomes stale and unusable due to non-availability of the broker. This >>>>>>>> would >>>>>>>> cause in your case an exception to be thrown. Since the exception is >>>>>>>> not >>>>>>>> trapped in any way, the code is not running in a container but on the >>>>>>>> Java >>>>>>>> mainline, the JVM is destroyed following the stack trace. >>>>>>>> >>>>>>>> If on the other hand, you add an exception handler to the camel route, >>>>>>>> you >>>>>>>> will find that the exception can be caught and handled without >>>>>>>> destroying >>>>>>>> the JVM. >>>>>>>> >>>>>>>> Hope this helps. >>>>>>>> >>>>>>>> Cheers, >>>>>>>> >>>>>>>> Ashwin... >>>>>>>> >>>>>>>> ----- >>>>>>>> --------------------------------------------------------- >>>>>>>> Ashwin Karpe >>>>>>>> Apache Camel Committer & Sr Principal Consultant >>>>>>>> FUSESource (a Progress Software Corporation subsidiary) >>>>>>>> http://fusesource.com >>>>>>>> >>>>>>>> Blog: http://opensourceknowledge.blogspot.com >>>>>>>> CamelOne 2011: http://fusesource.com/camel2011 >>>>>>>> --------------------------------------------------------- >>>>>>>> -- >>>>>>>> View this message in context: >>>>>>>> http://camel.465427.n5.nabble.com/Broker-shutdown-also-shuts-Camel-application-down-tp4549804p4551079.html >>>>>>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Claus Ibsen >>>> ----------------- >>>> FuseSource >>>> Email: cib...@fusesource.com >>>> Web: http://fusesource.com >>>> Twitter: davsclaus, fusenews >>>> Blog: http://davsclaus.blogspot.com/ >>>> Author of Camel in Action: http://www.manning.com/ibsen/ >>>> >>> >> >> >> >> -- >> Claus Ibsen >> ----------------- >> FuseSource >> Email: cib...@fusesource.com >> Web: http://fusesource.com >> Twitter: davsclaus, fusenews >> Blog: http://davsclaus.blogspot.com/ >> Author of Camel in Action: http://www.manning.com/ibsen/ >> > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/