You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicola Ferraro (JIRA)" <ji...@apache.org> on 2018/01/10 11:15:00 UTC
[jira] [Updated] (CAMEL-12134) spring-boot: two camel contexts
created when using xml configuration
[ https://issues.apache.org/jira/browse/CAMEL-12134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicola Ferraro updated CAMEL-12134:
-----------------------------------
Description:
When running the camel-example-spring-boot-xml, or any spring-boot camel application using xml route definition, camel seems to create 2 contexts.
It seems to happen only when using spring xml routes.
The second one has no routes. Camel fails to register it to jmx and adds a "-1" to its name.
{code}
a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
{code}
The relevant parts of the trace:
{code}
2018-01-10 12:00:26.538 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
2018-01-10 12:00:26.539 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2018-01-10 12:00:26.700 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2018-01-10 12:00:26.740 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Route: hello started and consuming from: timer://hello?period=2000
2018-01-10 12:00:26.742 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started
2018-01-10 12:00:26.743 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.204 seconds
2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2018-01-10 12:00:26.757 WARN 11245 --- [ main] a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
2018-01-10 12:00:26.762 INFO 11245 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Type converters loaded (core: 193, classpath: 1)
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 0 routes, of which 0 are started
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.013 seconds
{code}
was:
When running the camel-example-spring-boot-xml, or any spring-boot camel application using xml route definition, camel seems to create 2 contexts.
It seems to happen only when using xml routes.
The second one has no routes. Camel fails to register it to jmx and adds a "-1" to its name.
{code}
a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
{code}
The relevant parts of the trace:
{code}
2018-01-10 12:00:26.538 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
2018-01-10 12:00:26.539 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2018-01-10 12:00:26.700 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2018-01-10 12:00:26.740 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Route: hello started and consuming from: timer://hello?period=2000
2018-01-10 12:00:26.742 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started
2018-01-10 12:00:26.743 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.204 seconds
2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2018-01-10 12:00:26.757 WARN 11245 --- [ main] a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
2018-01-10 12:00:26.762 INFO 11245 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Type converters loaded (core: 193, classpath: 1)
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 0 routes, of which 0 are started
2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.013 seconds
{code}
> spring-boot: two camel contexts created when using xml configuration
> --------------------------------------------------------------------
>
> Key: CAMEL-12134
> URL: https://issues.apache.org/jira/browse/CAMEL-12134
> Project: Camel
> Issue Type: Bug
> Components: camel-spring-boot
> Affects Versions: 2.20.0, 2.20.1
> Reporter: Nicola Ferraro
> Assignee: Nicola Ferraro
> Fix For: 2.20.2, 2.21.0
>
>
> When running the camel-example-spring-boot-xml, or any spring-boot camel application using xml route definition, camel seems to create 2 contexts.
> It seems to happen only when using spring xml routes.
> The second one has no routes. Camel fails to register it to jmx and adds a "-1" to its name.
> {code}
> a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
> {code}
> The relevant parts of the trace:
> {code}
> 2018-01-10 12:00:26.538 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
> 2018-01-10 12:00:26.539 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
> 2018-01-10 12:00:26.700 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
> 2018-01-10 12:00:26.740 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Route: hello started and consuming from: timer://hello?period=2000
> 2018-01-10 12:00:26.742 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started
> 2018-01-10 12:00:26.743 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.204 seconds
> 2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) is starting
> 2018-01-10 12:00:26.757 INFO 11245 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
> 2018-01-10 12:00:26.757 WARN 11245 --- [ main] a.c.m.DefaultManagementLifecycleStrategy : This CamelContext(SampleCamel) will be registered using the name: SampleCamel-1 due to clash with an existing name already registered in MBeanServer.
> 2018-01-10 12:00:26.762 INFO 11245 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Type converters loaded (core: 193, classpath: 1)
> 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
> 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Total 0 routes, of which 0 are started
> 2018-01-10 12:00:26.770 INFO 11245 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.21.0-SNAPSHOT (CamelContext: SampleCamel) started in 0.013 seconds
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)