Thank you, Claus! I think, it might be also due to a class hierarchies
I have, but see my next mail about that.

Am Fr., 6. Dez. 2019 um 09:20 Uhr schrieb Claus Ibsen-2 [via Camel]
<ml+s465427n5850020...@n5.nabble.com>:
>
> On Fri, Dec 6, 2019 at 9:00 AM Dennis Holunder <[hidden email]> wrote:
> >
> > I removed @ApplicationScoped annotation from the route and graceful
> > shutdown doesn't appear in the log anymore. I guess, camel
> > auto-discovered the route by type and then also cdi discovered it by
> > annotation
> >
>
> Ah yeah I think we had something similar with camel-quarkus too.
> I created a ticket
> https://issues.apache.org/jira/browse/CAMEL-14265
>
> > Am Do., 5. Dez. 2019 um 18:43 Uhr schrieb Claus Ibsen-2 [via Camel]
> > <[hidden email]>:
> > >
> > > Hi
> > >
> > > I wonder if its because the routes are discovered twice and gets added
> > > and re-added again.
> > >
> > > Standalone CDI is not a often used runtime, so nobody have noticed
> > > anything. You are welcome to debug and see if you can spot something.
> > > Its possible in the main class of camel-cdi (that component is a bit
> > > bloated.)
> > >
> > > On Thu, Dec 5, 2019 at 3:36 PM Dennis Holunder <[hidden email]> wrote:
> > >
> > > >
> > > > its because routes are removed and stopped in
> > > > DefaultModel::addRouteDefinitions method. Stop triggers shutdown task
> > > >
> > > > And here is the trace:
> > > >
> > > > "main@1" prio=5 tid=0x1 nid=NA runnable
> > > >   java.lang.Thread.State: RUNNABLE
> > > >   at 
> > > > org.apache.camel.impl.engine.DefaultShutdownStrategy.doShutdown(DefaultShutdownStrategy.java:192)
> > > >   at 
> > > > org.apache.camel.impl.engine.DefaultShutdownStrategy.shutdown(DefaultShutdownStrategy.java:152)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext.doShutdownRoute(AbstractCamelContext.java:1237)
> > > >   - locked <0xf64> (a org.apache.camel.impl.DefaultCamelContext)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext.stopRoute(AbstractCamelContext.java:1220)
> > > >   at 
> > > > org.apache.camel.impl.engine.DefaultRouteController.stopRoute(DefaultRouteController.java:96)
> > > >   at 
> > > > org.apache.camel.impl.DefaultModel.removeRouteDefinition(DefaultModel.java:110)
> > > >   - locked <0xf68> (a org.apache.camel.impl.DefaultModel)
> > > >   at 
> > > > org.apache.camel.impl.DefaultModel.removeRouteDefinitions(DefaultModel.java:100)
> > > >   at 
> > > > org.apache.camel.impl.DefaultModel.addRouteDefinitions(DefaultModel.java:85)
> > > >   at 
> > > > org.apache.camel.impl.AbstractModelCamelContext.addRouteDefinitions(AbstractModelCamelContext.java:111)
> > > >   at 
> > > > org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:486)
> > > >   at 
> > > > org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:426)
> > > >   at 
> > > > com.company.MyRoute$Proxy$_$$_WeldClientProxy.addRoutesToCamelContext(Unknown
> > > > Source:-1)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext.lambda$addRoutes$0(AbstractCamelContext.java:1121)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext$$Lambda$71.1386020581.run(Unknown
> > > > Source:-1)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2462)
> > > >   at 
> > > > org.apache.camel.impl.engine.AbstractCamelContext.addRoutes(AbstractCamelContext.java:1121)
> > > >   at 
> > > > org.apache.camel.impl.DefaultCamelContext$Proxy$_$$_WeldClientProxy.addRoutes(Unknown
> > > > Source:-1)
> > > >   at 
> > > > org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:84)
> > > >   at 
> > > > org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:555)
> > > >   at 
> > > > org.apache.camel.main.BaseMainSupport.initCamelContext(BaseMainSupport.java:403)
> > > >   at org.apache.camel.cdi.Main.doStart(Main.java:103)
> > > >   at 
> > > > org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
> > > >   - locked <0x147e> (a java.lang.Object)
> > > >   at org.apache.camel.main.MainSupport.run(MainSupport.java:77)
> > > >   at 
> > > > org.apache.camel.main.MainCommandLineSupport.run(MainCommandLineSupport.java:150)
> > > >   at com.company.MyMain.main(MyMain.java:7)
> > > >
> > > > Am Do., 5. Dez. 2019 um 15:17 Uhr schrieb dennisholu [via Camel]
> > > > <[hidden email]>:
> > > > >
> > > > > Yes, the project keeps running, but the message about shutdown is
> > > > > still visible in the log. The log I posted above was from another
> > > > > project. In the app from attached zip it is:
> > > > >
> > > > > 2019-12-05 15:12:26,903 [main           ] INFO  DefaultCamelContext
> > > > >         - Apache Camel 3.0.0 (CamelContext: camel-1) started in 0.555
> > > > > seconds
> > > > > 2019-12-05 15:12:26,971 [main           ] INFO  Bootstrap
> > > > >         - WELD-ENV-002003: Weld SE container STATIC_INSTANCE
> > > > > initialized
> > > > > 2019-12-05 15:12:27,002 [main           ] INFO  BaseMainSupport
> > > > >         - Using properties from classpath:application.properties
> > > > > 2019-12-05 15:12:27,059 [main           ] INFO
> > > > > DefaultShutdownStrategy        - Starting to graceful shutdown 1
> > > > > routes (timeout 300 seconds)
> > > > > 2019-12-05 15:12:27,067 [ - ShutdownTask] INFO
> > > > > DefaultShutdownStrategy        - Route: route1 shutdown complete, was
> > > > > consuming from: timer://foo?fixedRate=true&period=5s
> > > > > 2019-12-05 15:12:27,067 [main           ] INFO
> > > > > DefaultShutdownStrategy        - Graceful shutdown of 1 routes
> > > > > completed in 0 seconds
> > > > > 2019-12-05 15:12:27,069 [main           ] INFO  DefaultCamelContext
> > > > >         - Route: route1 is stopped, was consuming from:
> > > > > timer://foo?fixedRate=true&period=5s
> > > > > 2019-12-05 15:12:27,071 [main           ] INFO  DefaultCamelContext
> > > > >         - Route: route1 is shutdown and removed, was consuming from:
> > > > > timer://foo?fixedRate=true&period=5s
> > > > > 2019-12-05 15:12:27,082 [main           ] INFO  DefaultCamelContext
> > > > >         - Route: route1 started and consuming from:
> > > > > timer://foo?fixedRate=true&period=5s
> > > > > 2019-12-05 15:12:27,086 [main           ] INFO  DefaultRoutesCollector
> > > > >         - Loading additional Camel XML routes from:
> > > > > classpath:camel/*.xml
> > > > > 2019-12-05 15:12:27,089 [main           ] INFO  DefaultRoutesCollector
> > > > >         - Loading additional Camel XML rests from:
> > > > > classpath:camel-rest/*.xml
> > > > >
> > > > > Maybe the route will work just fine, but it still confusing to see
> > > > > that in the log
> > > > >
> > > > > Am Do., 5. Dez. 2019 um 15:00 Uhr schrieb Claus Ibsen-2 [via Camel]
> > > > > <[hidden email]>:
> > > > >
> > > > > >
> > > > > > Also you can try with
> > > > > >
> > > > > > try {
> > > > > >    main.run
> > > > > > } catch (Throwable e) {
> > > > > >   e.printSt...
> > > > > >
> > > > > > to catch any kind of error and log/print it
> > > > > >
> > > > > > On Thu, Dec 5, 2019 at 2:57 PM Claus Ibsen <[hidden email]> wrote:
> > > > > >
> > > > > > >
> > > > > > > Hi
> > > > > > >
> > > > > > > The attached .zip file works for me. If I run it from IDEA then it
> > > > > > > keeps running.
> > > > > > >
> > > > > > > However the stacktrace you had had quartz in it, which this .zip 
> > > > > > > do not etc.
> > > > > > >
> > > > > > >
> > > > > > > 2019-12-05 14:56:01,039 [main           ] INFO  
> > > > > > > DefaultRoutesCollector
> > > > > > >         - Loading additional Camel XML rests from:
> > > > > > > classpath:camel-rest/*.xml
> > > > > > > processing
> > > > > > > 2019-12-05 14:56:02,063 [4 - timer://foo] INFO  route1
> > > > > > >         - running
> > > > > > > processing
> > > > > > > 2019-12-05 14:56:07,040 [4 - timer://foo] INFO  route1
> > > > > > >         - running
> > > > > > > processing
> > > > > > >
> > > > > > > On Thu, Dec 5, 2019 at 2:19 PM Dennis Holunder <[hidden email]> 
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > Hi Claus,
> > > > > > > >
> > > > > > > > Attached a small reproducer. Could you please have a look? 
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > Am Do., 5. Dez. 2019 um 13:51 Uhr schrieb dennisholu [via Camel]
> > > > > > > > <[hidden email]>:
> > > > > > > > >
> > > > > > > > > I ran it from IDE using Main:
> > > > > > > > >
> > > > > > > > > public class MyMain {
> > > > > > > > >     public static void main(String[] args) throws Exception {
> > > > > > > > >         org.apache.camel.cdi.Main camel = new 
> > > > > > > > > org.apache.camel.cdi.Main();
> > > > > > > > >         camel.run(args);
> > > > > > > > >     }
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > Am Do., 5. Dez. 2019 um 13:15 Uhr schrieb Claus Ibsen-2 [via 
> > > > > > > > > Camel]
> > > > > > > > > <[hidden email]>:
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hi
> > > > > > > > > >
> > > > > > > > > > You can try to debug and set a breakpoint and see maybe if 
> > > > > > > > > > there is
> > > > > > > > > > some way to know.
> > > > > > > > > >
> > > > > > > > > > Also how do you run your cdi app.
> > > > > > > > > >
> > > > > > > > > > On Thu, Dec 5, 2019 at 1:10 PM Dennis Holunder <[hidden 
> > > > > > > > > > email]> wrote:
> > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > I'm trying to migrate a CDI Route to camel-3 and seeing 
> > > > > > > > > > > in log that
> > > > > > > > > > > the route is starting graceful shutdown right after start.
> > > > > > > > > > >
> > > > > > > > > > > 12:04:00 [main] INFO  o.a.camel.impl.DefaultCamelContext  
> > > > > > > > > > > Apache Camel
> > > > > > > > > > > 3.0.0 (CamelContext: camel-1) started in 3.683 seconds
> > > > > > > > > > > 12:04:00 [main] DEBUG o.a.c.c.quartz.QuartzComponent  
> > > > > > > > > > > Storing
> > > > > > > > > > > camelContextName=camel-1 into Quartz Context space.
> > > > > > > > > > > 12:04:00 [main] INFO  o.a.c.c.quartz.QuartzComponent  
> > > > > > > > > > > Starting scheduler.
> > > > > > > > > > > 12:04:00 [main] INFO  org.quartz.core.QuartzScheduler  
> > > > > > > > > > > Scheduler
> > > > > > > > > > > DefaultQuartzScheduler-camel-1_$_NON_CLUSTERED started.
> > > > > > > > > > > 12:04:00 
> > > > > > > > > > > [DefaultQuartzScheduler-camel-1_QuartzSchedulerThread] 
> > > > > > > > > > > DEBUG
> > > > > > > > > > > o.quartz.core.QuartzSchedulerThread  batch acquisition of 
> > > > > > > > > > > 0 triggers
> > > > > > > > > > > 12:04:01 [main] DEBUG o.a.c.c.p.PropertiesComponent  
> > > > > > > > > > > Parsed location:
> > > > > > > > > > > application.properties
> > > > > > > > > > > 12:04:01 [main] INFO  o.apache.camel.main.BaseMainSupport 
> > > > > > > > > > >  Using
> > > > > > > > > > > properties from classpath:application.properties
> > > > > > > > > > > 12:04:01 [main] DEBUG o.apache.camel.main.BaseMainSupport 
> > > > > > > > > > >  Properties
> > > > > > > > > > > from Camel properties component:
> > > > > > > > > > > 12:04:01 [main] DEBUG 
> > > > > > > > > > > o.a.c.i.e.DefaultStreamCachingStrategy
> > > > > > > > > > > StreamCaching is not enabled
> > > > > > > > > > > 12:04:01 [main] DEBUG o.apache.camel.main.RoutesConfigurer
> > > > > > > > > > > RoutesCollectorEnabled:
> > > > > > > > > > > org.apache.camel.main.DefaultRoutesCollector@28393e82
> > > > > > > > > > > 12:04:01 [main] DEBUG o.a.c.main.DefaultRoutesCollector  
> > > > > > > > > > > Java
> > > > > > > > > > > RoutesBuilder: 
> > > > > > > > > > > com/company/MyRoute$Proxy$_$$_WeldClientProxy accepted
> > > > > > > > > > > by include/exclude filter: true
> > > > > > > > > > >
> > > > > > > > > > > 12:04:01 [main] DEBUG 
> > > > > > > > > > > o.apache.camel.main.RoutesConfigurer  Adding
> > > > > > > > > > > routes into CamelContext from RoutesBuilder: Routes: 
> > > > > > > > > > > (list of routes
> > > > > > > > > > > removed by me)
> > > > > > > > > > > 12:04:01 [main] DEBUG o.a.camel.impl.DefaultCamelContext  
> > > > > > > > > > > Adding
> > > > > > > > > > > routes from builder: Routes: (list of routes removed by 
> > > > > > > > > > > me)
> > > > > > > > > > > 12:04:01 [main] INFO  o.a.c.i.e.DefaultShutdownStrategy  
> > > > > > > > > > > Starting to
> > > > > > > > > > > graceful shutdown 1 routes (timeout 300 seconds)
> > > > > > > > > > >
> > > > > > > > > > > I tried to create a small reproducer project, but it is 
> > > > > > > > > > > working fine.
> > > > > > > > > > > Is there a way to find out what is triggering the 
> > > > > > > > > > > shutdown?
> > > > > > > > > > >
> > > > > > > > > > > Dan
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Claus Ibsen
> > > > > > > > > > -----------------
> > > > > > > > > > http://davsclaus.com @davsclaus
> > > > > > > > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ________________________________
> > > > > > > > > > If you reply to this email, your message will be added to 
> > > > > > > > > > the discussion below:
> > > > > > > > > > https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5849924.html
> > > > > > > > > > To unsubscribe from Camel, click here.
> > > > > > > > > > NAML
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > > If you reply to this email, your message will be added to the 
> > > > > > > > > discussion below:
> > > > > > > > > https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5849942.html
> > > > > > > > > To unsubscribe from Camel, click here.
> > > > > > > > > NAML
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Claus Ibsen
> > > > > > > -----------------
> > > > > > > http://davsclaus.com @davsclaus
> > > > > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Claus Ibsen
> > > > > > -----------------
> > > > > > http://davsclaus.com @davsclaus
> > > > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > If you reply to this email, your message will be added to the 
> > > > > > discussion below:
> > > > > > https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5849954.html
> > > > > > To unsubscribe from Camel, click here.
> > > > > > NAML
> > > > >
> > > > >
> > > > > ________________________________
> > > > > If you reply to this email, your message will be added to the 
> > > > > discussion below:
> > > > > https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5849956.html
> > > > > To unsubscribe from Camel, click here.
> > > > > NAML
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > http://davsclaus.com @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> > >
> > >
> > > ________________________________
> > > If you reply to this email, your message will be added to the discussion 
> > > below:
> > > https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5849991.html
> > > To unsubscribe from Camel, click here.
> > > NAML
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion 
> below:
> https://camel.465427.n5.nabble.com/Camel-3-shutdown-triggered-right-after-start-tp5849922p5850020.html
> To unsubscribe from Camel, click here.
> NAML

Reply via email to