You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stefan Lisowski <ro...@gmail.com> on 2018/12/20 04:25:26 UTC
JMX Camel New User Question: where do I put service:jmx:rmi...
Hi All -
I'm new to Camel. I'm trying to work through this example in the way
of something like Hello World for a JMX Camel connection.
https://github.com/apache/camel/tree/master/examples/camel-example-jmx
I can build it with maven and mvn camel:run works fine.
But now I want to start tweaking the program to learn how it works and
applies to my own environment. There's a JMX server here for ActiveMQ,
and I want to connect to it with this example.
I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
this example)
There's a "from" line. This looks like the candidate.
// START SNIPPET: e1
from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
to("log:jmxEvent");
// END SNIPPET: e1
but how do I put my URI in here? It looks something like:
service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
I wouldn't expect just pasting it in to the "from" area would work,
and it doesn't:
Failed to resolve endpoint:
service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
component found with scheme: service
I should also mention that I need to authenticate, so I have a
username and password I'll need to enter as well (though no SSL). Am I
looking in the right place in this example code?
Thanks. I know new-user questions can be painful to endure, so thanks
for your patience.
RW
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by RW <ro...@gmail.com>.
On 12/20/2018 8:59 PM, Eric Phetteplace wrote:
> This might help http://camel.apache.org/jmx.html
Thanks for that pointer to the right bit of documentation. I bet that'll
do it.
> On Dec 20, 2018 8:14 PM, Stefan Lisowski <ro...@gmail.com> wrote:
> Thank you Quinn, it does help. That's exactly what I was looking for.
>
> It would have taken me a while to figure out the proper syntax
> incantation "jmx:service:jmx:rmi:///jndi/rmi:/...jmxrmi?..."
>
> Now I just have to figure out how to add credentials. Can I add them
> into this "from" line
>
> ex: from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean&password=secret&username=admin”)
>
> or need I do something else like
>
> environment.put (JMXConnector.CREDENTIALS, credentials);
>
> (from: https://docs.oracle.com/cd/E19717-01/819-7758/gchjy/index.html )
>
> If there's TFM I should Read, feel free to point me at it.
>
> (I'd just go and test my first thought above with the URI but the
> service I'm trying to work with has gone down since I last looked at
> it.... working on getting that fixed.)
>
> Thanks again.
>
>
> Stefan
>
> On Thu, Dec 20, 2018 at 6:44 PM Quinn Stevenson
> <qu...@pronoia-solutions.com> wrote:
>>
>> Find your JMX URI for ActiveMQ - it will look something like
>>
>> service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi
>>
>> Then the from should be something like
>>
>> from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean”)
>>
>> HTH
>>
>>> On Dec 19, 2018, at 9:40 PM, RW <ro...@gmail.com> wrote:
>>>
>>> If I remove "service" before "jmx" I get:
>>>
>>> "Must specify domain" in my error. I actually am using the fully qualified domain name, not localhost, so that's not the issue...
>>>
>>> and if I further remove :12345/jmxrm I still get the same error about needing a domain.
>>>
>>>> Hi All -
>>>> I'm new to Camel. I'm trying to work through this example in the way
>>>> of something like Hello World for a JMX Camel connection.
>>>> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
>>>> I can build it with maven and mvn camel:run works fine.
>>>> But now I want to start tweaking the program to learn how it works and
>>>> applies to my own environment. There's a JMX server here for ActiveMQ,
>>>> and I want to connect to it with this example.
>>>> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
>>>> this example)
>>>> There's a "from" line. This looks like the candidate.
>>>> // START SNIPPET: e1
>>>> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
>>>> to("log:jmxEvent");
>>>> // END SNIPPET: e1
>>>> but how do I put my URI in here? It looks something like:
>>>> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
>>>> I wouldn't expect just pasting it in to the "from" area would work,
>>>> and it doesn't:
>>>> Failed to resolve endpoint:
>>>> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
>>>> component found with scheme: service
>>>> I should also mention that I need to authenticate, so I have a
>>>> username and password I'll need to enter as well (though no SSL). Am I
>>>> looking in the right place in this example code?
>>>> Thanks. I know new-user questions can be painful to endure, so thanks
>>>> for your patience.
>>>> RW
>>
>
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by Eric Phetteplace <er...@nextivr.com>.
This might help http://camel.apache.org/jmx.html
On Dec 20, 2018 8:14 PM, Stefan Lisowski <ro...@gmail.com> wrote:
Thank you Quinn, it does help. That's exactly what I was looking for.
It would have taken me a while to figure out the proper syntax
incantation "jmx:service:jmx:rmi:///jndi/rmi:/...jmxrmi?..."
Now I just have to figure out how to add credentials. Can I add them
into this "from" line
ex: from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean&password=secret&username=admin”)
or need I do something else like
environment.put (JMXConnector.CREDENTIALS, credentials);
(from: https://docs.oracle.com/cd/E19717-01/819-7758/gchjy/index.html )
If there's TFM I should Read, feel free to point me at it.
(I'd just go and test my first thought above with the URI but the
service I'm trying to work with has gone down since I last looked at
it.... working on getting that fixed.)
Thanks again.
Stefan
On Thu, Dec 20, 2018 at 6:44 PM Quinn Stevenson
<qu...@pronoia-solutions.com> wrote:
>
> Find your JMX URI for ActiveMQ - it will look something like
>
> service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi
>
> Then the from should be something like
>
> from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean”)
>
> HTH
>
> > On Dec 19, 2018, at 9:40 PM, RW <ro...@gmail.com> wrote:
> >
> > If I remove "service" before "jmx" I get:
> >
> > "Must specify domain" in my error. I actually am using the fully qualified domain name, not localhost, so that's not the issue...
> >
> > and if I further remove :12345/jmxrm I still get the same error about needing a domain.
> >
> >> Hi All -
> >> I'm new to Camel. I'm trying to work through this example in the way
> >> of something like Hello World for a JMX Camel connection.
> >> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
> >> I can build it with maven and mvn camel:run works fine.
> >> But now I want to start tweaking the program to learn how it works and
> >> applies to my own environment. There's a JMX server here for ActiveMQ,
> >> and I want to connect to it with this example.
> >> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
> >> this example)
> >> There's a "from" line. This looks like the candidate.
> >> // START SNIPPET: e1
> >> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
> >> to("log:jmxEvent");
> >> // END SNIPPET: e1
> >> but how do I put my URI in here? It looks something like:
> >> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
> >> I wouldn't expect just pasting it in to the "from" area would work,
> >> and it doesn't:
> >> Failed to resolve endpoint:
> >> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
> >> component found with scheme: service
> >> I should also mention that I need to authenticate, so I have a
> >> username and password I'll need to enter as well (though no SSL). Am I
> >> looking in the right place in this example code?
> >> Thanks. I know new-user questions can be painful to endure, so thanks
> >> for your patience.
> >> RW
>
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by Stefan Lisowski <ro...@gmail.com>.
Thank you Quinn, it does help. That's exactly what I was looking for.
It would have taken me a while to figure out the proper syntax
incantation "jmx:service:jmx:rmi:///jndi/rmi:/...jmxrmi?..."
Now I just have to figure out how to add credentials. Can I add them
into this "from" line
ex: from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean&password=secret&username=admin”)
or need I do something else like
environment.put (JMXConnector.CREDENTIALS, credentials);
(from: https://docs.oracle.com/cd/E19717-01/819-7758/gchjy/index.html )
If there's TFM I should Read, feel free to point me at it.
(I'd just go and test my first thought above with the URI but the
service I'm trying to work with has gone down since I last looked at
it.... working on getting that fixed.)
Thanks again.
Stefan
On Thu, Dec 20, 2018 at 6:44 PM Quinn Stevenson
<qu...@pronoia-solutions.com> wrote:
>
> Find your JMX URI for ActiveMQ - it will look something like
>
> service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi
>
> Then the from should be something like
>
> from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean”)
>
> HTH
>
> > On Dec 19, 2018, at 9:40 PM, RW <ro...@gmail.com> wrote:
> >
> > If I remove "service" before "jmx" I get:
> >
> > "Must specify domain" in my error. I actually am using the fully qualified domain name, not localhost, so that's not the issue...
> >
> > and if I further remove :12345/jmxrm I still get the same error about needing a domain.
> >
> >> Hi All -
> >> I'm new to Camel. I'm trying to work through this example in the way
> >> of something like Hello World for a JMX Camel connection.
> >> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
> >> I can build it with maven and mvn camel:run works fine.
> >> But now I want to start tweaking the program to learn how it works and
> >> applies to my own environment. There's a JMX server here for ActiveMQ,
> >> and I want to connect to it with this example.
> >> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
> >> this example)
> >> There's a "from" line. This looks like the candidate.
> >> // START SNIPPET: e1
> >> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
> >> to("log:jmxEvent");
> >> // END SNIPPET: e1
> >> but how do I put my URI in here? It looks something like:
> >> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
> >> I wouldn't expect just pasting it in to the "from" area would work,
> >> and it doesn't:
> >> Failed to resolve endpoint:
> >> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
> >> component found with scheme: service
> >> I should also mention that I need to authenticate, so I have a
> >> username and password I'll need to enter as well (though no SSL). Am I
> >> looking in the right place in this example code?
> >> Thanks. I know new-user questions can be painful to endure, so thanks
> >> for your patience.
> >> RW
>
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
Find your JMX URI for ActiveMQ - it will look something like
service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi
Then the from should be something like
from("jmx:service:jmx:rmi:///jndi/rmi:/localhost:1099/jmxrmi?objectDomain=jmxExample&key.name=simpleBean”)
HTH
> On Dec 19, 2018, at 9:40 PM, RW <ro...@gmail.com> wrote:
>
> If I remove "service" before "jmx" I get:
>
> "Must specify domain" in my error. I actually am using the fully qualified domain name, not localhost, so that's not the issue...
>
> and if I further remove :12345/jmxrm I still get the same error about needing a domain.
>
>> Hi All -
>> I'm new to Camel. I'm trying to work through this example in the way
>> of something like Hello World for a JMX Camel connection.
>> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
>> I can build it with maven and mvn camel:run works fine.
>> But now I want to start tweaking the program to learn how it works and
>> applies to my own environment. There's a JMX server here for ActiveMQ,
>> and I want to connect to it with this example.
>> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
>> this example)
>> There's a "from" line. This looks like the candidate.
>> // START SNIPPET: e1
>> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
>> to("log:jmxEvent");
>> // END SNIPPET: e1
>> but how do I put my URI in here? It looks something like:
>> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
>> I wouldn't expect just pasting it in to the "from" area would work,
>> and it doesn't:
>> Failed to resolve endpoint:
>> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
>> component found with scheme: service
>> I should also mention that I need to authenticate, so I have a
>> username and password I'll need to enter as well (though no SSL). Am I
>> looking in the right place in this example code?
>> Thanks. I know new-user questions can be painful to endure, so thanks
>> for your patience.
>> RW
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by RW <ro...@gmail.com>.
If I remove "service" before "jmx" I get:
"Must specify domain" in my error. I actually am using the fully
qualified domain name, not localhost, so that's not the issue...
and if I further remove :12345/jmxrm I still get the same error about
needing a domain.
> Hi All -
>
> I'm new to Camel. I'm trying to work through this example in the way
> of something like Hello World for a JMX Camel connection.
>
> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
>
> I can build it with maven and mvn camel:run works fine.
>
> But now I want to start tweaking the program to learn how it works and
> applies to my own environment. There's a JMX server here for ActiveMQ,
> and I want to connect to it with this example.
>
> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
> this example)
>
> There's a "from" line. This looks like the candidate.
>
> // START SNIPPET: e1
> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
> to("log:jmxEvent");
> // END SNIPPET: e1
>
> but how do I put my URI in here? It looks something like:
> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
>
> I wouldn't expect just pasting it in to the "from" area would work,
> and it doesn't:
> Failed to resolve endpoint:
> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
> component found with scheme: service
>
> I should also mention that I need to authenticate, so I have a
> username and password I'll need to enter as well (though no SSL). Am I
> looking in the right place in this example code?
>
> Thanks. I know new-user questions can be painful to endure, so thanks
> for your patience.
>
> RW
>
Re: JMX Camel New User Question: where do I put service:jmx:rmi...
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Btw there is also jolokia that can make JMX easier as it can expose
the data via REST over HTTP.
http://www.jolokia.org/
And Jolokia comes out of the box with ActiveMQ.
Then its just standard HTTP and one port you need to be open, and not
as tricky to setup and secure as JMX over RMI can be.
On Thu, Dec 20, 2018 at 5:25 AM Stefan Lisowski <ro...@gmail.com> wrote:
>
> Hi All -
>
> I'm new to Camel. I'm trying to work through this example in the way
> of something like Hello World for a JMX Camel connection.
>
> https://github.com/apache/camel/tree/master/examples/camel-example-jmx
>
> I can build it with maven and mvn camel:run works fine.
>
> But now I want to start tweaking the program to learn how it works and
> applies to my own environment. There's a JMX server here for ActiveMQ,
> and I want to connect to it with this example.
>
> I'm thinking I do this with the RouteBuilder. (MyRouteBuilder.java in
> this example)
>
> There's a "from" line. This looks like the candidate.
>
> // START SNIPPET: e1
> from("jmx:platform?objectDomain=jmxExample&key.name=simpleBean").
> to("log:jmxEvent");
> // END SNIPPET: e1
>
> but how do I put my URI in here? It looks something like:
> service:jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi
>
> I wouldn't expect just pasting it in to the "from" area would work,
> and it doesn't:
> Failed to resolve endpoint:
> service://jmx:rmi:///jndi/rmi://localhost:12345/jmxrmi due to: No
> component found with scheme: service
>
> I should also mention that I need to authenticate, so I have a
> username and password I'll need to enter as well (though no SSL). Am I
> looking in the right place in this example code?
>
> Thanks. I know new-user questions can be painful to endure, so thanks
> for your patience.
>
> RW
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2