You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by camel-fan <fl...@yahoo.com> on 2010/03/03 21:27:07 UTC

Using custom processor with JMX and JConsole

Hi all,

I am trying to enable a simple processor to be JMX enabled and visible in
JConsole.

I have read http://camel.apache.org/camel-jmx.html and defined my processor
as follows (simplified it a bit): 

@ManagedResource(description = "Managed Processor" )
public class MyProcessor implements Processor, ManagementAware<MyProcessor>,
Service {

    @ManagedAttribute
    public String getFoo() {
        return "bar";
    }
    @Override
    public Object getManagedObject(MyProcessor arg0) {
        return this;
    }
    @Override
    public void process(Exchange exchange) throws Exception {}
    @Override
     public void start() throws Exception {}
     @Override
     public void stop() throws Exception {}
}

The problem is that I can't see my processor in JConsole, I can connect to
camel context and see all the running
components/endpoints/processors/services etc... but I don't see my own
processor listed. 

The processor is registered as a bean in my spring xml config simply as:
<bean id="myprocessor" class="MyProcessor"></bean>

The processor is working in my routes. 

Am I missing something?

I am using: JDK 1.6, Camel 2.1, Spring 2.5.6

I really appreciate any help you can provide!



-- 
View this message in context: http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27772716.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using custom processor with JMX and JConsole

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Mar 4, 2010 at 9:31 PM, camel-fan <fl...@yahoo.com> wrote:
>
> Thanks for the tip... but I had looked at the FAQ at the bottom and all it
> said was to implement Service, i.e. org.apache.camel.Service . I actually
> did this on my processor.
>
> Any other ideas? :)

Ah you did. You can enable DEBUG logging on
org.apache.camel.management and it should log which mbeans is being
registered.
Then check if there is something about your processor.

Also try using the latest release which is Camel 2.2.0.


>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> At the very bottom of the JMX wiki page is a section about processors
>> and a link to a FAQ :)
>>
>>
>> On Wed, Mar 3, 2010 at 9:27 PM, camel-fan <fl...@yahoo.com>
>> wrote:
>>>
>>> Hi all,
>>>
>>> I am trying to enable a simple processor to be JMX enabled and visible in
>>> JConsole.
>>>
>>> I have read http://camel.apache.org/camel-jmx.html and defined my
>>> processor
>>> as follows (simplified it a bit):
>>>
>>> @ManagedResource(description = "Managed Processor" )
>>> public class MyProcessor implements Processor,
>>> ManagementAware<MyProcessor>,
>>> Service {
>>>
>>>    @ManagedAttribute
>>>    public String getFoo() {
>>>        return "bar";
>>>    }
>>>    @Override
>>>    public Object getManagedObject(MyProcessor arg0) {
>>>        return this;
>>>    }
>>>    @Override
>>>    public void process(Exchange exchange) throws Exception {}
>>>    @Override
>>>     public void start() throws Exception {}
>>>     @Override
>>>     public void stop() throws Exception {}
>>> }
>>>
>>> The problem is that I can't see my processor in JConsole, I can connect
>>> to
>>> camel context and see all the running
>>> components/endpoints/processors/services etc... but I don't see my own
>>> processor listed.
>>>
>>> The processor is registered as a bean in my spring xml config simply as:
>>> <bean id="myprocessor" class="MyProcessor"></bean>
>>>
>>> The processor is working in my routes.
>>>
>>> Am I missing something?
>>>
>>> I am using: JDK 1.6, Camel 2.1, Spring 2.5.6
>>>
>>> I really appreciate any help you can provide!
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27772716.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27786155.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Using custom processor with JMX and JConsole

Posted by camel-fan <fl...@yahoo.com>.
Thanks for the tip... but I had looked at the FAQ at the bottom and all it
said was to implement Service, i.e. org.apache.camel.Service . I actually
did this on my processor. 

Any other ideas? :)


Claus Ibsen-2 wrote:
> 
> Hi
> 
> At the very bottom of the JMX wiki page is a section about processors
> and a link to a FAQ :)
> 
> 
> On Wed, Mar 3, 2010 at 9:27 PM, camel-fan <fl...@yahoo.com>
> wrote:
>>
>> Hi all,
>>
>> I am trying to enable a simple processor to be JMX enabled and visible in
>> JConsole.
>>
>> I have read http://camel.apache.org/camel-jmx.html and defined my
>> processor
>> as follows (simplified it a bit):
>>
>> @ManagedResource(description = "Managed Processor" )
>> public class MyProcessor implements Processor,
>> ManagementAware<MyProcessor>,
>> Service {
>>
>>    @ManagedAttribute
>>    public String getFoo() {
>>        return "bar";
>>    }
>>    @Override
>>    public Object getManagedObject(MyProcessor arg0) {
>>        return this;
>>    }
>>    @Override
>>    public void process(Exchange exchange) throws Exception {}
>>    @Override
>>     public void start() throws Exception {}
>>     @Override
>>     public void stop() throws Exception {}
>> }
>>
>> The problem is that I can't see my processor in JConsole, I can connect
>> to
>> camel context and see all the running
>> components/endpoints/processors/services etc... but I don't see my own
>> processor listed.
>>
>> The processor is registered as a bean in my spring xml config simply as:
>> <bean id="myprocessor" class="MyProcessor"></bean>
>>
>> The processor is working in my routes.
>>
>> Am I missing something?
>>
>> I am using: JDK 1.6, Camel 2.1, Spring 2.5.6
>>
>> I really appreciate any help you can provide!
>>
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27772716.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27786155.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using custom processor with JMX and JConsole

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

At the very bottom of the JMX wiki page is a section about processors
and a link to a FAQ :)


On Wed, Mar 3, 2010 at 9:27 PM, camel-fan <fl...@yahoo.com> wrote:
>
> Hi all,
>
> I am trying to enable a simple processor to be JMX enabled and visible in
> JConsole.
>
> I have read http://camel.apache.org/camel-jmx.html and defined my processor
> as follows (simplified it a bit):
>
> @ManagedResource(description = "Managed Processor" )
> public class MyProcessor implements Processor, ManagementAware<MyProcessor>,
> Service {
>
>    @ManagedAttribute
>    public String getFoo() {
>        return "bar";
>    }
>    @Override
>    public Object getManagedObject(MyProcessor arg0) {
>        return this;
>    }
>    @Override
>    public void process(Exchange exchange) throws Exception {}
>    @Override
>     public void start() throws Exception {}
>     @Override
>     public void stop() throws Exception {}
> }
>
> The problem is that I can't see my processor in JConsole, I can connect to
> camel context and see all the running
> components/endpoints/processors/services etc... but I don't see my own
> processor listed.
>
> The processor is registered as a bean in my spring xml config simply as:
> <bean id="myprocessor" class="MyProcessor"></bean>
>
> The processor is working in my routes.
>
> Am I missing something?
>
> I am using: JDK 1.6, Camel 2.1, Spring 2.5.6
>
> I really appreciate any help you can provide!
>
>
>
> --
> View this message in context: http://old.nabble.com/Using-custom-processor-with-JMX-and-JConsole-tp27772716p27772716.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus