You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dermoritz <ta...@hotmail.com> on 2014/12/10 16:41:36 UTC

jmx- annotated RouteBuilder not showing up in JConsole

I tried to annotate a RouteBuilder with @ManagedResource and a method from it
with @ManagedOperation but i can't find it in JConsole. The other classes
including my annotated custom endpoint is showing up fine.

I am not sure if these annotations work with all kinds of classes within
camel?! In my case the annotated RouteBuilder is some kind of central
control class. Is does not contain a route but is loading several other
RouteBuilders. It also adds global (context scope) exception handlers and
adds a RoutePolicyFactory that centrally handles start up and control logic.

The methods i want to make available via JMX re method that start/stop
certain groups of routes.



--
View this message in context: http://camel.465427.n5.nabble.com/jmx-annotated-RouteBuilder-not-showing-up-in-JConsole-tp5760486.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: jmx- annotated RouteBuilder not showing up in JConsole

Posted by dermoritz <ta...@hotmail.com>.
Thanks for the hint that helped much - i tried both. on first site there is
no different in extending ServiceSupport (onStart, onStop mus be added) or
implementing Service (start, stop methods must be added).



--
View this message in context: http://camel.465427.n5.nabble.com/jmx-annotated-RouteBuilder-not-showing-up-in-JConsole-tp5760486p5760691.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: jmx- annotated RouteBuilder not showing up in JConsole

Posted by Claus Ibsen <cl...@gmail.com>.
You can also implement the Service interface, you dont need to extend
ServiceSupport though that is often favored.

On Thu, Dec 11, 2014 at 12:48 PM, dermoritz <ta...@hotmail.com> wrote:
> Thanks for this hints. i will try this.
> In my case i would need an separate class (my RouteBuilder is extending
> RouteBuilder) but that's no problem. in long term it is probably better to
> have an separate class for jmx controls.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/jmx-annotated-RouteBuilder-not-showing-up-in-JConsole-tp5760486p5760561.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: jmx- annotated RouteBuilder not showing up in JConsole

Posted by dermoritz <ta...@hotmail.com>.
Thanks for this hints. i will try this.
In my case i would need an separate class (my RouteBuilder is extending
RouteBuilder) but that's no problem. in long term it is probably better to
have an separate class for jmx controls.



--
View this message in context: http://camel.465427.n5.nabble.com/jmx-annotated-RouteBuilder-not-showing-up-in-JConsole-tp5760486p5760561.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: jmx- annotated RouteBuilder not showing up in JConsole

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

It needs to extends ServiceSupport and depending on how its created,
you may need to manually add it to camel context, using addService so
Camel can register it as a service and in jmx

On Wed, Dec 10, 2014 at 4:41 PM, dermoritz <ta...@hotmail.com> wrote:
> I tried to annotate a RouteBuilder with @ManagedResource and a method from it
> with @ManagedOperation but i can't find it in JConsole. The other classes
> including my annotated custom endpoint is showing up fine.
>
> I am not sure if these annotations work with all kinds of classes within
> camel?! In my case the annotated RouteBuilder is some kind of central
> control class. Is does not contain a route but is loading several other
> RouteBuilders. It also adds global (context scope) exception handlers and
> adds a RoutePolicyFactory that centrally handles start up and control logic.
>
> The methods i want to make available via JMX re method that start/stop
> certain groups of routes.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/jmx-annotated-RouteBuilder-not-showing-up-in-JConsole-tp5760486.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/