[
https://issues.apache.org/jira/browse/CAMEL-15307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17161030#comment-17161030
]
Oliver Holzmann commented on CAMEL-15307:
-----------------------------------------
You can easily test this with the archetype {{camel-archetype-spring}}.
After generating a test project with this archetype I added a delay of 20
seconds to the route and started Camel with {{mvn camel:run}}
With Camel 3.4.1 the files are not getting processed when killing the JVM with
{{Strg-C}} when the files are read. The JVM stops immediately without writing
the file to the target folder.
When doing the same with Camel 2.24.3 the shutdown waits until the consumed
file is processed. The consumed file is copied to the target folder in the end.
I don't have the possibility to test on non windows OS.
> camel-spring - Graceful shutdown is not working anymore
> --------------------------------------------------------
>
> Key: CAMEL-15307
> URL: https://issues.apache.org/jira/browse/CAMEL-15307
> Project: Camel
> Issue Type: Bug
> Components: camel-spring
> Affects Versions: 3.3.0, 3.4.0, 3.4.1
> Environment: Windows 10
> openJDK 1.8, Oracle JDK 1.8
> Reporter: Oliver Holzmann
> Priority: Minor
>
> We are using {{org.apache.camel.spring.Main}} to run our Camel applications
> within a spring context. After updating from Camel 2.24.3 to 3.4.1 the
> gracefull shutdown is not working anymore.
> When calling {{Strg+C}} in a windows shell (or stopping a service wrapper)
> the camel context is not stopped/closed and the jvm simply stops after
> logging this:
> {code:java}
> 2020-07-17 08:49:17,559 [ad #7 - CamelHangupInterceptor] INFO
> DefaultMainShutdownStrategy - Received hang up - stopping the main
> instance.
> 2020-07-17 08:49:17,559 [pache.camel.spring.Main.main()] DEBUG MainSupport
> - Stopping Spring ApplicationContext:
> org.springframework.context.support.ClassPathXmlApplicationContext@15512f1a
> {code}
> In Camel 2.25.1 gracefull shutdown also works fine.
> Also using Camel version 3.4.0 or 3.3.0 didn't solve the issue.
> I debugged the behaviour and found that, when keeping the
> {{CamelHangupInterceptor}} thread from
> {{org.apache.camel.main.DefaultMainShutdownStrategy}} running after the
> {{shutdown}} call, the Camel context is stopped correctly. But when the
> {{CamelHangupInterceptor}} thread ends also the JVM is stopping.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)