Hi,
we are trying to use two camel contexts with JMX. It seems to us that the
endpoints are not correctly registered - in fact it looks like the contexts
are mixed up. We debugged up to InstrumentationLifecycleStrategy, where it
looks like that starting the contexts and registering the endpoints is in
uncorrect order. Setting a breakpoint to onEndpointAdd shows that adding
endpoints to jmx happens for one context berofe it is initialized.
Debugging further it looks like it is basically not only a problem in the
jmx component, but in initializing contexts and assiging endpoints to
context. Although two contexts are initialized, all endpoints seems to be
assigned to only one context - independent of the definition.
Example:
We set up two routes: Route1 renames file1.txt to file2.txt and route2
renames file2.txt back to file1.txt. Note that file1.txt must be present in
the directory if the route should do anything (which is not necessary for
the example).
<camel:camelContext id="Context1">
<camel:endpoint id="fromFile"
uri="file://tmp?fileName=file1.txt&delay=2000"/>
<camel:endpoint id="toFile" uri="file://tmp?fileName=file2.txt"/>
<camel:route id="route1">
<camel:from ref="fromFile"/>
<camel:to ref="toFile"/>
</camel:route>
</camel:camelContext>
<camel:camelContext id="Context2">
<camel:endpoint id="fromFile2"
uri="file://tmp?fileName=file2.txt&delay=3000"/>
<camel:endpoint id="toFile2" uri="file://tmp?fileName=file1.txt"/>
<camel:route id="route2">
<camel:from ref="fromFile2"/>
<camel:to ref="toFile2"/>
</camel:route>
</camel:camelContext>
If you now get this with jmx (we used jconsole) not all endpoint are
registered as you can see in the following clipping of jconsole (note that
context1 has no of the defined endpoints):
http://www.nabble.com/file/p23520282/jconsoletworoutes.png
jconsoletworoutes.png .
If we change the whole thing to be in one camel context everything is fine.
Defining:
<camel:camelContext id="Context1">
<camel:endpoint id="fromFile"
uri="file://tmp?fileName=file1.txt&delay=2000"/>
<camel:endpoint id="toFile" uri="file://tmp?fileName=file2.txt"/>
<camel:endpoint id="fromFile2"
uri="file://tmp?fileName=file2.txt&delay=3000"/>
<camel:endpoint id="toFile2" uri="file://tmp?fileName=file1.txt"/>
<camel:route id="route1">
<camel:from ref="fromFile"/>
<camel:to ref="toFile"/>
</camel:route>
<camel:route id="route2">
<camel:from ref="fromFile2"/>
<camel:to ref="toFile2"/>
</camel:route>
</camel:camelContext>
This leads to http://www.nabble.com/file/p23520282/jconsoleoneroute.png
jconsoleoneroute.png where all endpoints are visible and monitored.
This also holds if the two camel contexts use different
mbeanObjectDomainName-settings.
Any ideas what the problem could be?
We are using Camel-2.0-M1, Java 1.6, Tomcat 6.0.
Thanks,
Siegfried
--
View this message in context:
http://www.nabble.com/Two-camel-contexts-and-assinging-endpoints-%28visible-by-jconsole%2C-jmx%29-tp23520282p23520282.html
Sent from the Camel - Users mailing list archive at Nabble.com.