You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Aaron Daubman <da...@gmail.com> on 2012/04/11 01:04:17 UTC

Just started receiving 'MainSupport$HangupInterceptor' immediately after start, triggering a shutdown

Greetings,

I am now seeing my camel app start up and immediately intercept a hangup
and shutdown without any hangup being sent:
...
[                          main] SpringCamelContext             INFO
 Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
seconds
[                      Thread-2] MainSupport$HangupInterceptor  INFO
 Received hang up - stopping the main instance.
[                      Thread-2] MainSupport                    INFO
 Apache Camel 2.10-SNAPSHOT stopping
...

Some background - I am using the camel-spring main with hangup support.
---snip---
    public static void main(String... args) throws Exception {
        // use the Main class from camel-spring
        Main main = new Main();
        // to load Spring XML file
        main.setApplicationContextUri("META-INF/spring/camel-context.xml");
        // and enable hangup support which means we can stop nicely when
ctrl+c is pressed
        main.enableHangupSupport();
        // and start (will wait until you stop with ctrl + c)
        main.start();
    }
---snip---

I am using camel 2.10-SNAPSHOT on a mac running OS X 10.7.3 with the latest
java 6, running from terminal.

I just changed around some routes a little and am now seeing the following
when attempting to start my camel app:
---snip---
# /usr/bin/java -server -Xms1g -Xmx1g -classpath classes:lib/'*'
arcsightingest.arcSightIngest
[                          main] ipToHandle                     INFO
 network.bin does not exist, attempting to create from network.txt
[                          main] handleToZip                    INFO
 address.bin does not exist, attempting to create from address.txt
[                          main] zipToLatLon                    INFO
 GeoLiteCity-Location.bin does not exist, attempting to create from
GeoLiteCity-Location.csv
[                          main] orgTreeMapper                  INFO
 org_link.bin does not exist, attempting to create from org_link.txt
[                          main] MainSupport                    INFO
 Apache Camel 2.10-SNAPSHOT starting
[                          main] SpringCamelContext             INFO
 Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is starting
[                          main] ManagementStrategyFactory      INFO  JMX
enabled.
[                          main] ultManagementLifecycleStrategy INFO
 StatisticsLevel at All so enabling load performance statistics
[                          main] DefaultTypeConverter           INFO
 Loaded 170 type converters
[                          main] AggregateProcessor             INFO  Using
CompletionInterval to run every 5000 millis.
[                          main] SpringCamelContext             INFO
 Route: debuglog started and consuming from: Endpoint[direct://debuglog]
[                          main] SpringCamelContext             INFO
 Route: infolog started and consuming from: Endpoint[direct://infolog]
[                          main] SpringCamelContext             INFO
 Route: warnlog started and consuming from: Endpoint[direct://warnlog]
[                          main] SpringCamelContext             INFO
 Route: errorlog started and consuming from: Endpoint[direct://errorlog]
[                          main] SpringCamelContext             INFO
 Route: database started and consuming from: Endpoint[direct://aggregated]
[                          main] SpringCamelContext             INFO
 Route: splitAndAggregate started and consuming from:
Endpoint[direct://sorted]
[                          main] SpringCamelContext             INFO
 Route: sortList started and consuming from: Endpoint[direct://parsed]
[                          main] SpringCamelContext             INFO
 Route: parseCsv started and consuming from: Endpoint[direct://files]
[                          main] SpringCamelContext             INFO
 Route: logReader started and consuming from:
Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
[                          main] SpringCamelContext             INFO  Total
9 routes, of which 9 is started.
[                          main] SpringCamelContext             INFO
 Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
seconds
[                      Thread-2] MainSupport$HangupInterceptor  INFO
 Received hang up - stopping the main instance.
[                      Thread-2] MainSupport                    INFO
 Apache Camel 2.10-SNAPSHOT stopping
[                      Thread-2] SpringCamelContext             INFO
 Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutting down
[                      Thread-2] DefaultShutdownStrategy        INFO
 Starting to graceful shutdown 9 routes (timeout 300 seconds)
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: logReader shutdown complete, was consuming from:
Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: parseCsv shutdown complete, was consuming from:
Endpoint[direct://files]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: sortList shutdown complete, was consuming from:
Endpoint[direct://parsed]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: splitAndAggregate shutdown complete, was consuming from:
Endpoint[direct://sorted]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: database shutdown complete, was consuming from:
Endpoint[direct://aggregated]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: errorlog shutdown complete, was consuming from:
Endpoint[direct://errorlog]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: warnlog shutdown complete, was consuming from:
Endpoint[direct://warnlog]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: infolog shutdown complete, was consuming from:
Endpoint[direct://infolog]
[gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
 Route: debuglog shutdown complete, was consuming from:
Endpoint[direct://debuglog]
[                      Thread-2] DefaultShutdownStrategy        INFO
 Graceful shutdown of 9 routes completed in 0 seconds
[                      Thread-2] SpringCamelContext             INFO
 Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutdown in
0.046 seconds. Uptime 1.193 seconds.
---snip---

Any pointers? - I am confused as to where the hangup is coming from,
especially since there is nothing else logged.

Thanks!
     Aaron

Re: Just started receiving 'MainSupport$HangupInterceptor' immediately after start, triggering a shutdown

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Apr 11, 2012 at 1:38 AM, Aaron Daubman <da...@gmail.com> wrote:
> Just in case another users does something foolish like I have...
>
> the fix was to change
> main.start()
> to
> main.run()
>
> ...not sure how I got that mixed up (or why no error was logged). It must
> have been working previously as I was previously testing with 'mvn
> camel:run'
>

Ah yeah mvn camel:run acts like Main.run.

And I guess when the JVM is stopping when you exit the main loop, when
you used .start(), then the hangup still gets a signal from the JVM
that the JVM is terminating, and therefore it also logs.

We have this FAQ also
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html

I wonder if the javadoc on the Main class is documenting the
difference between start and run? If not we could possible improved
that.


> Thanks,
>     Aaron
>
> On Tue, Apr 10, 2012 at 7:04 PM, Aaron Daubman <da...@gmail.com> wrote:
>
>> Greetings,
>>
>> I am now seeing my camel app start up and immediately intercept a hangup
>> and shutdown without any hangup being sent:
>> ...
>> [                          main] SpringCamelContext             INFO
>>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
>> seconds
>> [                      Thread-2] MainSupport$HangupInterceptor  INFO
>>  Received hang up - stopping the main instance.
>> [                      Thread-2] MainSupport                    INFO
>>  Apache Camel 2.10-SNAPSHOT stopping
>> ...
>>
>> Some background - I am using the camel-spring main with hangup support.
>> ---snip---
>>     public static void main(String... args) throws Exception {
>>         // use the Main class from camel-spring
>>         Main main = new Main();
>>         // to load Spring XML file
>>         main.setApplicationContextUri("META-INF/spring/camel-context.xml");
>>         // and enable hangup support which means we can stop nicely when
>> ctrl+c is pressed
>>         main.enableHangupSupport();
>>         // and start (will wait until you stop with ctrl + c)
>>         main.start();
>>     }
>> ---snip---
>>
>> I am using camel 2.10-SNAPSHOT on a mac running OS X 10.7.3 with the
>> latest java 6, running from terminal.
>>
>> I just changed around some routes a little and am now seeing the following
>> when attempting to start my camel app:
>> ---snip---
>> # /usr/bin/java -server -Xms1g -Xmx1g -classpath classes:lib/'*'
>> arcsightingest.arcSightIngest
>> [                          main] ipToHandle                     INFO
>>  network.bin does not exist, attempting to create from network.txt
>> [                          main] handleToZip                    INFO
>>  address.bin does not exist, attempting to create from address.txt
>> [                          main] zipToLatLon                    INFO
>>  GeoLiteCity-Location.bin does not exist, attempting to create from
>> GeoLiteCity-Location.csv
>> [                          main] orgTreeMapper                  INFO
>>  org_link.bin does not exist, attempting to create from org_link.txt
>> [                          main] MainSupport                    INFO
>>  Apache Camel 2.10-SNAPSHOT starting
>> [                          main] SpringCamelContext             INFO
>>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is starting
>> [                          main] ManagementStrategyFactory      INFO  JMX
>> enabled.
>> [                          main] ultManagementLifecycleStrategy INFO
>>  StatisticsLevel at All so enabling load performance statistics
>> [                          main] DefaultTypeConverter           INFO
>>  Loaded 170 type converters
>> [                          main] AggregateProcessor             INFO
>>  Using CompletionInterval to run every 5000 millis.
>> [                          main] SpringCamelContext             INFO
>>  Route: debuglog started and consuming from: Endpoint[direct://debuglog]
>> [                          main] SpringCamelContext             INFO
>>  Route: infolog started and consuming from: Endpoint[direct://infolog]
>> [                          main] SpringCamelContext             INFO
>>  Route: warnlog started and consuming from: Endpoint[direct://warnlog]
>> [                          main] SpringCamelContext             INFO
>>  Route: errorlog started and consuming from: Endpoint[direct://errorlog]
>> [                          main] SpringCamelContext             INFO
>>  Route: database started and consuming from: Endpoint[direct://aggregated]
>> [                          main] SpringCamelContext             INFO
>>  Route: splitAndAggregate started and consuming from:
>> Endpoint[direct://sorted]
>> [                          main] SpringCamelContext             INFO
>>  Route: sortList started and consuming from: Endpoint[direct://parsed]
>> [                          main] SpringCamelContext             INFO
>>  Route: parseCsv started and consuming from: Endpoint[direct://files]
>> [                          main] SpringCamelContext             INFO
>>  Route: logReader started and consuming from:
>> Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
>> [                          main] SpringCamelContext             INFO
>>  Total 9 routes, of which 9 is started.
>> [                          main] SpringCamelContext             INFO
>>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
>> seconds
>> [                      Thread-2] MainSupport$HangupInterceptor  INFO
>>  Received hang up - stopping the main instance.
>> [                      Thread-2] MainSupport                    INFO
>>  Apache Camel 2.10-SNAPSHOT stopping
>> [                      Thread-2] SpringCamelContext             INFO
>>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutting down
>> [                      Thread-2] DefaultShutdownStrategy        INFO
>>  Starting to graceful shutdown 9 routes (timeout 300 seconds)
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: logReader shutdown complete, was consuming from:
>> Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: parseCsv shutdown complete, was consuming from:
>> Endpoint[direct://files]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: sortList shutdown complete, was consuming from:
>> Endpoint[direct://parsed]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: splitAndAggregate shutdown complete, was consuming from:
>> Endpoint[direct://sorted]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: database shutdown complete, was consuming from:
>> Endpoint[direct://aggregated]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: errorlog shutdown complete, was consuming from:
>> Endpoint[direct://errorlog]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: warnlog shutdown complete, was consuming from:
>> Endpoint[direct://warnlog]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: infolog shutdown complete, was consuming from:
>> Endpoint[direct://infolog]
>> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>>  Route: debuglog shutdown complete, was consuming from:
>> Endpoint[direct://debuglog]
>> [                      Thread-2] DefaultShutdownStrategy        INFO
>>  Graceful shutdown of 9 routes completed in 0 seconds
>> [                      Thread-2] SpringCamelContext             INFO
>>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutdown in
>> 0.046 seconds. Uptime 1.193 seconds.
>> ---snip---
>>
>> Any pointers? - I am confused as to where the hangup is coming from,
>> especially since there is nothing else logged.
>>
>> Thanks!
>>      Aaron
>>



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Just started receiving 'MainSupport$HangupInterceptor' immediately after start, triggering a shutdown

Posted by Aaron Daubman <da...@gmail.com>.
Just in case another users does something foolish like I have...

the fix was to change
main.start()
to
main.run()

...not sure how I got that mixed up (or why no error was logged). It must
have been working previously as I was previously testing with 'mvn
camel:run'

Thanks,
     Aaron

On Tue, Apr 10, 2012 at 7:04 PM, Aaron Daubman <da...@gmail.com> wrote:

> Greetings,
>
> I am now seeing my camel app start up and immediately intercept a hangup
> and shutdown without any hangup being sent:
> ...
> [                          main] SpringCamelContext             INFO
>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
> seconds
> [                      Thread-2] MainSupport$HangupInterceptor  INFO
>  Received hang up - stopping the main instance.
> [                      Thread-2] MainSupport                    INFO
>  Apache Camel 2.10-SNAPSHOT stopping
> ...
>
> Some background - I am using the camel-spring main with hangup support.
> ---snip---
>     public static void main(String... args) throws Exception {
>         // use the Main class from camel-spring
>         Main main = new Main();
>         // to load Spring XML file
>         main.setApplicationContextUri("META-INF/spring/camel-context.xml");
>         // and enable hangup support which means we can stop nicely when
> ctrl+c is pressed
>         main.enableHangupSupport();
>         // and start (will wait until you stop with ctrl + c)
>         main.start();
>     }
> ---snip---
>
> I am using camel 2.10-SNAPSHOT on a mac running OS X 10.7.3 with the
> latest java 6, running from terminal.
>
> I just changed around some routes a little and am now seeing the following
> when attempting to start my camel app:
> ---snip---
> # /usr/bin/java -server -Xms1g -Xmx1g -classpath classes:lib/'*'
> arcsightingest.arcSightIngest
> [                          main] ipToHandle                     INFO
>  network.bin does not exist, attempting to create from network.txt
> [                          main] handleToZip                    INFO
>  address.bin does not exist, attempting to create from address.txt
> [                          main] zipToLatLon                    INFO
>  GeoLiteCity-Location.bin does not exist, attempting to create from
> GeoLiteCity-Location.csv
> [                          main] orgTreeMapper                  INFO
>  org_link.bin does not exist, attempting to create from org_link.txt
> [                          main] MainSupport                    INFO
>  Apache Camel 2.10-SNAPSHOT starting
> [                          main] SpringCamelContext             INFO
>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is starting
> [                          main] ManagementStrategyFactory      INFO  JMX
> enabled.
> [                          main] ultManagementLifecycleStrategy INFO
>  StatisticsLevel at All so enabling load performance statistics
> [                          main] DefaultTypeConverter           INFO
>  Loaded 170 type converters
> [                          main] AggregateProcessor             INFO
>  Using CompletionInterval to run every 5000 millis.
> [                          main] SpringCamelContext             INFO
>  Route: debuglog started and consuming from: Endpoint[direct://debuglog]
> [                          main] SpringCamelContext             INFO
>  Route: infolog started and consuming from: Endpoint[direct://infolog]
> [                          main] SpringCamelContext             INFO
>  Route: warnlog started and consuming from: Endpoint[direct://warnlog]
> [                          main] SpringCamelContext             INFO
>  Route: errorlog started and consuming from: Endpoint[direct://errorlog]
> [                          main] SpringCamelContext             INFO
>  Route: database started and consuming from: Endpoint[direct://aggregated]
> [                          main] SpringCamelContext             INFO
>  Route: splitAndAggregate started and consuming from:
> Endpoint[direct://sorted]
> [                          main] SpringCamelContext             INFO
>  Route: sortList started and consuming from: Endpoint[direct://parsed]
> [                          main] SpringCamelContext             INFO
>  Route: parseCsv started and consuming from: Endpoint[direct://files]
> [                          main] SpringCamelContext             INFO
>  Route: logReader started and consuming from:
> Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
> [                          main] SpringCamelContext             INFO
>  Total 9 routes, of which 9 is started.
> [                          main] SpringCamelContext             INFO
>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) started in 1.140
> seconds
> [                      Thread-2] MainSupport$HangupInterceptor  INFO
>  Received hang up - stopping the main instance.
> [                      Thread-2] MainSupport                    INFO
>  Apache Camel 2.10-SNAPSHOT stopping
> [                      Thread-2] SpringCamelContext             INFO
>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutting down
> [                      Thread-2] DefaultShutdownStrategy        INFO
>  Starting to graceful shutdown 9 routes (timeout 300 seconds)
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: logReader shutdown complete, was consuming from:
> Endpoint[file:///AppRootDir/customArcSightIngest/inbox?autoCreate=false&include=.*.txt&move=/AppRootDir/customArcSightIngest/inbox/completed&moveFailed=/AppRootDir/customArcSightIngest/inbox/error&preMove=/AppRootDir/customArcSightIngest/inbox/inprogress&runLoggingLevel=DEBUG&sortBy=file:modified&startingDirectoryMustExist=true]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: parseCsv shutdown complete, was consuming from:
> Endpoint[direct://files]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: sortList shutdown complete, was consuming from:
> Endpoint[direct://parsed]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: splitAndAggregate shutdown complete, was consuming from:
> Endpoint[direct://sorted]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: database shutdown complete, was consuming from:
> Endpoint[direct://aggregated]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: errorlog shutdown complete, was consuming from:
> Endpoint[direct://errorlog]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: warnlog shutdown complete, was consuming from:
> Endpoint[direct://warnlog]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: infolog shutdown complete, was consuming from:
> Endpoint[direct://infolog]
> [gest) thread #3 - ShutdownTask] DefaultShutdownStrategy        INFO
>  Route: debuglog shutdown complete, was consuming from:
> Endpoint[direct://debuglog]
> [                      Thread-2] DefaultShutdownStrategy        INFO
>  Graceful shutdown of 9 routes completed in 0 seconds
> [                      Thread-2] SpringCamelContext             INFO
>  Apache Camel 2.10-SNAPSHOT (CamelContext: arcSightIngest) is shutdown in
> 0.046 seconds. Uptime 1.193 seconds.
> ---snip---
>
> Any pointers? - I am confused as to where the hangup is coming from,
> especially since there is nothing else logged.
>
> Thanks!
>      Aaron
>