You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tyler Durvik <ph...@gmail.com> on 2013/08/21 15:35:02 UTC

Connecting remotely via JMX

I have routes defined using Java DSL and want to connect to the JVM
remotely to monitor the Camel Processors using jconsole.  Is there
something special that I must do in the Java DSL to enable remote JMX?
 Even when I'm on the same machine, jconsole can only connect when I choose
the PID.  The URL I am using to try and connect is:

service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel

I did notice in my Java DSL that the method

getContext().getManagementStrategy().getManagementAgent().getCreateConnector()

returns false.  I set it to true and get the same results.  What am I doing
wrong?  I am using Camel version 2.11.1.

Re: Is there a bug with file:// endpoint, or user error?

Posted by Chris <cw...@gmail.com>.
Thanks, Claus - I vaguely was a aware there was something to handle 
password param values, I just didn't make the connection that it could 
be used generally to prevent URL encoding - I'll give that a try.

      -Chris

On 8/22/2013 2:34 AM, Claus Ibsen wrote:
> You can try use RAW for this big and ugly regexp
> http://camel.apache.org/how-do-i-configure-endpoints.html
>
> On Wed, Aug 21, 2013 at 4:00 PM, Chris <cw...@gmail.com> wrote:
>> When I try to use the "include" option when defining an SFTP endpoint,
>> sometimes it works, other times the endpoint URI gets totally scrambled,
>> depending on the regular express for "include". The point at which the URI
>> gets scrambled is after URISupport.normalizeUri(uri)  is called.  I tried
>> pre-URI-encoding the regular expression, but then it gets URI-encoded twice
>> in that case.
>>


Re: Is there a bug with file:// endpoint, or user error?

Posted by Claus Ibsen <cl...@gmail.com>.
You can try use RAW for this big and ugly regexp
http://camel.apache.org/how-do-i-configure-endpoints.html

On Wed, Aug 21, 2013 at 4:00 PM, Chris <cw...@gmail.com> wrote:
> When I try to use the "include" option when defining an SFTP endpoint,
> sometimes it works, other times the endpoint URI gets totally scrambled,
> depending on the regular express for "include". The point at which the URI
> gets scrambled is after URISupport.normalizeUri(uri)  is called.  I tried
> pre-URI-encoding the regular expression, but then it gets URI-encoded twice
> in that case.
>
> Any ideas or corrections as to how I'm using the "include" option?
>
> BTW, I this is a runtime-generated endpoint, so I can't use a
> GenericFileFilter<T> instance because I have yet to find an easy way to
> programmatically add objects to the Springframework bean factory (Camel
> registry) at runtime.
>
> Thanks,
>
> Chris
>
> Parameters:
> port=21000, binary=true, username=adpt5, host=localhost,
> localWorkDirectory=target/res/tmp/local, idempotent=true, scheme=sftp,
> directory=target/res/home, password=adpt5, move=archive/${file:name},
> separator=UNIX,
> include=(^[\w|\W&&[^_]]+)(_MKT_)(\d\d\d\d\d\d\d\d)(_(HISTORY))?(_(.[^\.]+))?\..+}
>
> URI before  URISupport.normalizeUri(uri) is called:
>
> sftp://localhost:21000?username=adpt5&binary=true&idempotent=true&localWorkDirectory=target%2Fres%2Ftmp%2Flocal&directory=target%2Fres%2Fhome&password=adpt5&separator=UNIX&move=archive%2F%24%7Bfile%3Aname%7D&include=%28%5E%5B%5Cw%7C%5CW%26%26%5B%5E_%5D%5D%2B%29%28_MKT_%29%28%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%29%28_%28HISTORY%29%29%3F%28_%28.%5B%5E%5C.%5D%2B%29%29%3F%5C..%2B
>
> URI, scrambled after URISupport.normalizeUri(uri) is called:
>
> Failed to resolve endpoint:
> sftp://localhost:21000?&%5B%5E_%5D%5D%2B%29%28_MKT_%29%28%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%29%28_%28HISTORY%29%29%3F%28_%28.%5B%5E%5C.%5D%2B%29%29%3F%5C..%2B&binary=true&directory=target%2Fres%2Fhome&idempotent=true&include=%28%5E%5B%5Cw%7C%5CW&localWorkDirectory=target%2Fres%2Ftmp%2Flocal&move=archive%2F%24%7Bfile%3Aname%7D&password=adpt5&separator=UNIX&username=adpt5
> due to: There are 2 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties
> of the endpoint. Unknown parameters=[{=null,
> [^_]]+)(_MKT_)(\d\d\d\d\d\d\d\d)(_(HISTORY))?(_(.[^\.]+))?\..+=null}
>



-- 
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

Is there a bug with file:// endpoint, or user error?

Posted by Chris <cw...@gmail.com>.
When I try to use the "include" option when defining an SFTP endpoint, 
sometimes it works, other times the endpoint URI gets totally scrambled, 
depending on the regular express for "include". The point at which the 
URI gets scrambled is after URISupport.normalizeUri(uri)  is called.  I 
tried pre-URI-encoding the regular expression, but then it gets 
URI-encoded twice in that case.

Any ideas or corrections as to how I'm using the "include" option?

BTW, I this is a runtime-generated endpoint, so I can't use a 
GenericFileFilter<T> instance because I have yet to find an easy way to 
programmatically add objects to the Springframework bean factory (Camel 
registry) at runtime.

Thanks,

Chris

Parameters:
port=21000, binary=true, username=adpt5, host=localhost,
localWorkDirectory=target/res/tmp/local, idempotent=true, scheme=sftp,
directory=target/res/home, password=adpt5, move=archive/${file:name}, 
separator=UNIX,
include=(^[\w|\W&&[^_]]+)(_MKT_)(\d\d\d\d\d\d\d\d)(_(HISTORY))?(_(.[^\.]+))?\..+}

URI before  URISupport.normalizeUri(uri) is called:

sftp://localhost:21000?username=adpt5&binary=true&idempotent=true&localWorkDirectory=target%2Fres%2Ftmp%2Flocal&directory=target%2Fres%2Fhome&password=adpt5&separator=UNIX&move=archive%2F%24%7Bfile%3Aname%7D&include=%28%5E%5B%5Cw%7C%5CW%26%26%5B%5E_%5D%5D%2B%29%28_MKT_%29%28%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%29%28_%28HISTORY%29%29%3F%28_%28.%5B%5E%5C.%5D%2B%29%29%3F%5C..%2B

URI, scrambled after URISupport.normalizeUri(uri) is called:

Failed to resolve endpoint: 
sftp://localhost:21000?&%5B%5E_%5D%5D%2B%29%28_MKT_%29%28%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%5Cd%29%28_%28HISTORY%29%29%3F%28_%28.%5B%5E%5C.%5D%2B%29%29%3F%5C..%2B&binary=true&directory=target%2Fres%2Fhome&idempotent=true&include=%28%5E%5B%5Cw%7C%5CW&localWorkDirectory=target%2Fres%2Ftmp%2Flocal&move=archive%2F%24%7Bfile%3Aname%7D&password=adpt5&separator=UNIX&username=adpt5 
due to: There are 2 parameters that couldn't be set on the endpoint. 
Check the uri if the parameters are spelt correctly and that they are 
properties of the endpoint. Unknown parameters=[{=null, 
[^_]]+)(_MKT_)(\d\d\d\d\d\d\d\d)(_(HISTORY))?(_(.[^\.]+))?\..+=null}


Re: Connecting remotely via JMX

Posted by Christian Müller <ch...@gmail.com>.
You may use unintentionally a proxy to access your Camel JMX MBean server?

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Aug 26, 2013 at 3:05 PM, Tyler Durvik <ph...@gmail.com> wrote:

> The error message I receive is from JConsole, saying that it cannot
> connect.
>
> I am using JDK 1.7.0_25 on Windows 7 (Firewall turned off BTW).
>
>
>
> On Thu, Aug 22, 2013 at 8:43 PM, Willem jiang <willem.jiang@gmail.com
> >wrote:
>
> > What's the error did you get?
> > BTW, which version of JDK were you using?
> >
> >
> > --
> > Willem Jiang
> >
> > Red Hat, Inc.
> > Web: http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> > (English)
> >           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> >
> >
> > On Thursday, August 22, 2013 at 11:48 PM, Tyler Durvik wrote:
> >
> > > Here's my Java code:
> > >
> > > public static void main(String[] args) throws Exception {
> > >
> > > CamelContext camelCtx = new DefaultCamelContext();
> > >
> >
> camelCtx.getManagementStrategy().getManagementAgent().setCreateConnector(true);
> > >
> >
> camelCtx.getManagementStrategy().getManagementAgent().setUsePlatformMBeanServer(true);
> > >
> >
> camelCtx.getManagementStrategy().getManagementAgent().setMBeanObjectDomainName("com.a.b.c");
> > >
> >
> camelCtx.getManagementStrategy().getManagementAgent().setRegisterNewRoutes(true);
> > > camelCtx.getManagementStrategy().getManagementAgent().start();
> > > camelCtx.addRoutes(new JavaRouteBuilder());
> > > camelCtx.start();
> > > }
> > >
> > > And my route builder:
> > >
> > > public class JavaRouteBuilder extends RouteBuilder {
> > >
> > > public void configure() {
> > > from("file://input")
> > > .log("HELLO");
> > > }
> > > }
> > >
> > > In jconsole, when I try and connect to:
> > >
> > > service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi/camel
> > >
> > > It fails.
> > >
> > >
> > >
> > > On Thu, Aug 22, 2013 at 11:16 AM, Claus Ibsen <claus.ibsen@gmail.com
> (mailto:
> > claus.ibsen@gmail.com)> wrote:
> > >
> > > > Before you call the .start() method on CamelContext, you can
> configure
> > > > Camel.
> > > >
> > > >
> > > > On Thu, Aug 22, 2013 at 2:48 PM, Mark <elihusmails@gmail.com(mailto:
> > elihusmails@gmail.com)> wrote:
> > > > > How is that done using Java DSL? I am doing "mvn exec:java".
> > > > >
> > > > >
> > > > >
> > > > > On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <
> claus.ibsen@gmail.com(mailto:
> > claus.ibsen@gmail.com)>
> > > > wrote:
> > > > >
> > > > > > Hi
> > > > > >
> > > > > > Did you configure the JMX settings before you started
> CamelContext?
> > > > > > This is needed for it to have effect.
> > > > > >
> > > > > >
> > > > > > On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <
> phangbyte@gmail.com(mailto:
> > phangbyte@gmail.com)>
> > > > wrote:
> > > > > > > I "ported" my java DSL to Spring DSL and can connect using the
> > JMX
> > > > > >
> > > > >
> > > >
> > > >
> > > > URI:
> > > > > > >
> > > > > > > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
> > > > > > >
> > > > > > > I did add the following line in the Spring DSL:
> > > > > > >
> > > > > > > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
> > > > > > >
> > > > > > > In the Java DSL I have the following:
> > > > > > >
> > > > > > > ManagementAgent agent =
> > > > > > > getContext().getManagementStrategy().getManagementAgent();
> > > > > > > if( !agent.getCreateConnector() )
> > > > > > > agent.setCreateConnector( true );
> > > > > > >
> > > > > > > agent.setUsePlatformMBeanServer(true);
> > > > > > > agent.setMBeanObjectDomainName("com.a.b.c");
> > > > > > >
> > > > > > > And it doesn't help me at all.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <
> > phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > > > wrote:
> > > > > > >
> > > > > > > > Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <
> > phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > I am running standalone. Created the project using "mvn
> > > > > > > > > archetype:generate" and went through the steps to create a
> > Java DSL
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > project.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <
> > claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)
> > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Are you running standalone or in some server/container?
> > And if so
> > > > > > which
> > > > > > > > > > one?
> > > > > > > > > >
> > > > > > > > > > On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <
> > phangbyte@gmail.com (mailto:phangbyte@gmail.com)
> > > > >
> > > > > > > > > > wrote:
> > > > > > > > > > > I have routes defined using Java DSL and want to
> connect
> > to the
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > JVM
> > > > > > > > > > > remotely to monitor the Camel Processors using
> jconsole.
> > Is
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > there
> > > > > > > > > > > something special that I must do in the Java DSL to
> > enable remote
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > JMX?
> > > > > > > > > > > Even when I'm on the same machine, jconsole can only
> > connect
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > when I
> > > > > > > > > > choose
> > > > > > > > > > > the PID. The URL I am using to try and connect is:
> > > > > > > > > > >
> > > > > > > > > > > service:jmx:rmi:///jndi/rmi://<computer
> > name>:1099/jmxrmi/camel
> > > > > > > > > > >
> > > > > > > > > > > I did notice in my Java DSL that the method
> > > >
> >
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> > > > > > > > > > >
> > > > > > > > > > > returns false. I set it to true and get the same
> > results. What
> > > > am
> > > > > > I
> > > > > > > > > > doing
> > > > > > > > > > > wrong? I am using Camel version 2.11.1.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Claus Ibsen
> > > > > > > > > > -----------------
> > > > > > > > > > Red Hat, Inc.
> > > > > > > > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > > > > > > > Twitter: davsclaus
> > > > > > > > > > Blog: http://davsclaus.com
> > > > > > > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Claus Ibsen
> > > > > > -----------------
> > > > > > Red Hat, Inc.
> > > > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > > > Twitter: davsclaus
> > > > > > Blog: http://davsclaus.com
> > > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > >
> >
> >
> >
> >
>

Re: Connecting remotely via JMX

Posted by Tyler Durvik <ph...@gmail.com>.
The error message I receive is from JConsole, saying that it cannot
connect.

I am using JDK 1.7.0_25 on Windows 7 (Firewall turned off BTW).



On Thu, Aug 22, 2013 at 8:43 PM, Willem jiang <wi...@gmail.com>wrote:

> What's the error did you get?
> BTW, which version of JDK were you using?
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> Web: http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, August 22, 2013 at 11:48 PM, Tyler Durvik wrote:
>
> > Here's my Java code:
> >
> > public static void main(String[] args) throws Exception {
> >
> > CamelContext camelCtx = new DefaultCamelContext();
> >
> camelCtx.getManagementStrategy().getManagementAgent().setCreateConnector(true);
> >
> camelCtx.getManagementStrategy().getManagementAgent().setUsePlatformMBeanServer(true);
> >
> camelCtx.getManagementStrategy().getManagementAgent().setMBeanObjectDomainName("com.a.b.c");
> >
> camelCtx.getManagementStrategy().getManagementAgent().setRegisterNewRoutes(true);
> > camelCtx.getManagementStrategy().getManagementAgent().start();
> > camelCtx.addRoutes(new JavaRouteBuilder());
> > camelCtx.start();
> > }
> >
> > And my route builder:
> >
> > public class JavaRouteBuilder extends RouteBuilder {
> >
> > public void configure() {
> > from("file://input")
> > .log("HELLO");
> > }
> > }
> >
> > In jconsole, when I try and connect to:
> >
> > service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi/camel
> >
> > It fails.
> >
> >
> >
> > On Thu, Aug 22, 2013 at 11:16 AM, Claus Ibsen <claus.ibsen@gmail.com(mailto:
> claus.ibsen@gmail.com)> wrote:
> >
> > > Before you call the .start() method on CamelContext, you can configure
> > > Camel.
> > >
> > >
> > > On Thu, Aug 22, 2013 at 2:48 PM, Mark <elihusmails@gmail.com (mailto:
> elihusmails@gmail.com)> wrote:
> > > > How is that done using Java DSL? I am doing "mvn exec:java".
> > > >
> > > >
> > > >
> > > > On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <claus.ibsen@gmail.com(mailto:
> claus.ibsen@gmail.com)>
> > > wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > Did you configure the JMX settings before you started CamelContext?
> > > > > This is needed for it to have effect.
> > > > >
> > > > >
> > > > > On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <phangbyte@gmail.com(mailto:
> phangbyte@gmail.com)>
> > > wrote:
> > > > > > I "ported" my java DSL to Spring DSL and can connect using the
> JMX
> > > > >
> > > >
> > >
> > >
> > > URI:
> > > > > >
> > > > > > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
> > > > > >
> > > > > > I did add the following line in the Spring DSL:
> > > > > >
> > > > > > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
> > > > > >
> > > > > > In the Java DSL I have the following:
> > > > > >
> > > > > > ManagementAgent agent =
> > > > > > getContext().getManagementStrategy().getManagementAgent();
> > > > > > if( !agent.getCreateConnector() )
> > > > > > agent.setCreateConnector( true );
> > > > > >
> > > > > > agent.setUsePlatformMBeanServer(true);
> > > > > > agent.setMBeanObjectDomainName("com.a.b.c");
> > > > > >
> > > > > > And it doesn't help me at all.
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <
> phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > > wrote:
> > > > > >
> > > > > > > Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <
> phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > > wrote:
> > > > > > >
> > > > > > > > I am running standalone. Created the project using "mvn
> > > > > > > > archetype:generate" and went through the steps to create a
> Java DSL
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > project.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <
> claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)
> > > > > > wrote:
> > > > > > > >
> > > > > > > > > Are you running standalone or in some server/container?
> And if so
> > > > > which
> > > > > > > > > one?
> > > > > > > > >
> > > > > > > > > On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <
> phangbyte@gmail.com (mailto:phangbyte@gmail.com)
> > > >
> > > > > > > > > wrote:
> > > > > > > > > > I have routes defined using Java DSL and want to connect
> to the
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > > JVM
> > > > > > > > > > remotely to monitor the Camel Processors using jconsole.
> Is
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > > there
> > > > > > > > > > something special that I must do in the Java DSL to
> enable remote
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > JMX?
> > > > > > > > > > Even when I'm on the same machine, jconsole can only
> connect
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > > when I
> > > > > > > > > choose
> > > > > > > > > > the PID. The URL I am using to try and connect is:
> > > > > > > > > >
> > > > > > > > > > service:jmx:rmi:///jndi/rmi://<computer
> name>:1099/jmxrmi/camel
> > > > > > > > > >
> > > > > > > > > > I did notice in my Java DSL that the method
> > >
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> > > > > > > > > >
> > > > > > > > > > returns false. I set it to true and get the same
> results. What
> > > am
> > > > > I
> > > > > > > > > doing
> > > > > > > > > > wrong? I am using Camel version 2.11.1.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Claus Ibsen
> > > > > > > > > -----------------
> > > > > > > > > Red Hat, Inc.
> > > > > > > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > > > > > > Twitter: davsclaus
> > > > > > > > > Blog: http://davsclaus.com
> > > > > > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Claus Ibsen
> > > > > -----------------
> > > > > Red Hat, Inc.
> > > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > > Twitter: davsclaus
> > > > > Blog: http://davsclaus.com
> > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > Red Hat, Inc.
> > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > Twitter: davsclaus
> > > Blog: http://davsclaus.com
> > > Author of Camel in Action: http://www.manning.com/ibsen
> >
>
>
>
>

Re: Connecting remotely via JMX

Posted by Willem jiang <wi...@gmail.com>.
What's the error did you get?
BTW, which version of JDK were you using?


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, August 22, 2013 at 11:48 PM, Tyler Durvik wrote:

> Here's my Java code:
>  
> public static void main(String[] args) throws Exception {
>  
> CamelContext camelCtx = new DefaultCamelContext();
> camelCtx.getManagementStrategy().getManagementAgent().setCreateConnector(true);
> camelCtx.getManagementStrategy().getManagementAgent().setUsePlatformMBeanServer(true);
> camelCtx.getManagementStrategy().getManagementAgent().setMBeanObjectDomainName("com.a.b.c");
> camelCtx.getManagementStrategy().getManagementAgent().setRegisterNewRoutes(true);
> camelCtx.getManagementStrategy().getManagementAgent().start();
> camelCtx.addRoutes(new JavaRouteBuilder());
> camelCtx.start();
> }
>  
> And my route builder:
>  
> public class JavaRouteBuilder extends RouteBuilder {
>  
> public void configure() {
> from("file://input")
> .log("HELLO");
> }
> }
>  
> In jconsole, when I try and connect to:
>  
> service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi/camel
>  
> It fails.
>  
>  
>  
> On Thu, Aug 22, 2013 at 11:16 AM, Claus Ibsen <claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)> wrote:
>  
> > Before you call the .start() method on CamelContext, you can configure
> > Camel.
> >  
> >  
> > On Thu, Aug 22, 2013 at 2:48 PM, Mark <elihusmails@gmail.com (mailto:elihusmails@gmail.com)> wrote:
> > > How is that done using Java DSL? I am doing "mvn exec:java".
> > >  
> > >  
> > >  
> > > On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)>
> > wrote:
> > >  
> > > > Hi
> > > >  
> > > > Did you configure the JMX settings before you started CamelContext?
> > > > This is needed for it to have effect.
> > > >  
> > > >  
> > > > On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > wrote:
> > > > > I "ported" my java DSL to Spring DSL and can connect using the JMX
> > > >  
> > >  
> >  
> >  
> > URI:
> > > > >  
> > > > > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
> > > > >  
> > > > > I did add the following line in the Spring DSL:
> > > > >  
> > > > > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
> > > > >  
> > > > > In the Java DSL I have the following:
> > > > >  
> > > > > ManagementAgent agent =
> > > > > getContext().getManagementStrategy().getManagementAgent();
> > > > > if( !agent.getCreateConnector() )
> > > > > agent.setCreateConnector( true );
> > > > >  
> > > > > agent.setUsePlatformMBeanServer(true);
> > > > > agent.setMBeanObjectDomainName("com.a.b.c");
> > > > >  
> > > > > And it doesn't help me at all.
> > > > >  
> > > > >  
> > > > >  
> > > > > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > wrote:
> > > > >  
> > > > > > Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <phangbyte@gmail.com (mailto:phangbyte@gmail.com)>
> > > > wrote:
> > > > > >  
> > > > > > > I am running standalone. Created the project using "mvn
> > > > > > > archetype:generate" and went through the steps to create a Java DSL
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > project.
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)
> > > > > wrote:
> > > > > > >  
> > > > > > > > Are you running standalone or in some server/container? And if so
> > > > which
> > > > > > > > one?
> > > > > > > >  
> > > > > > > > On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <phangbyte@gmail.com (mailto:phangbyte@gmail.com)
> > >  
> > > > > > > > wrote:
> > > > > > > > > I have routes defined using Java DSL and want to connect to the
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
> > JVM
> > > > > > > > > remotely to monitor the Camel Processors using jconsole. Is
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
> > there
> > > > > > > > > something special that I must do in the Java DSL to enable remote
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > JMX?
> > > > > > > > > Even when I'm on the same machine, jconsole can only connect
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
> > when I
> > > > > > > > choose
> > > > > > > > > the PID. The URL I am using to try and connect is:
> > > > > > > > >  
> > > > > > > > > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
> > > > > > > > >  
> > > > > > > > > I did notice in my Java DSL that the method
> > getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> > > > > > > > >  
> > > > > > > > > returns false. I set it to true and get the same results. What
> > am
> > > > I
> > > > > > > > doing
> > > > > > > > > wrong? I am using Camel version 2.11.1.
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > --
> > > > > > > > Claus Ibsen
> > > > > > > > -----------------
> > > > > > > > Red Hat, Inc.
> > > > > > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > > > > > Twitter: davsclaus
> > > > > > > > Blog: http://davsclaus.com
> > > > > > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > >  
> >  
> >  
> >  
> >  
> >  
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
>  




Re: Connecting remotely via JMX

Posted by Tyler Durvik <ph...@gmail.com>.
Here's my Java code:

public static void main(String[] args) throws Exception {

CamelContext camelCtx = new DefaultCamelContext();
camelCtx.getManagementStrategy().getManagementAgent().setCreateConnector(true);
camelCtx.getManagementStrategy().getManagementAgent().setUsePlatformMBeanServer(true);
camelCtx.getManagementStrategy().getManagementAgent().setMBeanObjectDomainName("com.a.b.c");
camelCtx.getManagementStrategy().getManagementAgent().setRegisterNewRoutes(true);
camelCtx.getManagementStrategy().getManagementAgent().start();
camelCtx.addRoutes(new JavaRouteBuilder());
camelCtx.start();
}

And my route builder:

public class JavaRouteBuilder extends RouteBuilder {

    public void configure() {
    from("file://input")
    .log("HELLO");
    }
}

In jconsole, when I try and connect to:

service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi/camel

It fails.



On Thu, Aug 22, 2013 at 11:16 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Before you call the .start() method on CamelContext, you can configure
> Camel.
>
>
> On Thu, Aug 22, 2013 at 2:48 PM, Mark <el...@gmail.com> wrote:
> > How is that done using Java DSL?  I am doing "mvn exec:java".
> >
> >
> >
> > On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <cl...@gmail.com>
> wrote:
> >
> >> Hi
> >>
> >> Did you configure the JMX settings before you started CamelContext?
> >> This is needed for it to have effect.
> >>
> >>
> >> On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <ph...@gmail.com>
> wrote:
> >> > I "ported" my java DSL to Spring DSL and can connect using the JMX
> URI:
> >> >
> >> > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
> >> >
> >> > I did add the following line in the Spring DSL:
> >> >
> >> > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
> >> >
> >> > In the Java DSL I have the following:
> >> >
> >> > ManagementAgent agent =
> >> > getContext().getManagementStrategy().getManagementAgent();
> >> > if( !agent.getCreateConnector() )
> >> > agent.setCreateConnector( true );
> >> >
> >> > agent.setUsePlatformMBeanServer(true);
> >> > agent.setMBeanObjectDomainName("com.a.b.c");
> >> >
> >> > And it doesn't help me at all.
> >> >
> >> >
> >> >
> >> > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <ph...@gmail.com>
> >> wrote:
> >> >
> >> >> Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
> >> >>
> >> >>
> >> >>
> >> >> On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com>
> >> wrote:
> >> >>
> >> >>> I am running standalone.  Created the project using "mvn
> >> >>> archetype:generate" and went through the steps to create a Java DSL
> >> project.
> >> >>>
> >> >>>
> >> >>>
> >> >>> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <claus.ibsen@gmail.com
> >> >wrote:
> >> >>>
> >> >>>> Are you running standalone or in some server/container? And if so
> >> which
> >> >>>> one?
> >> >>>>
> >> >>>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <phangbyte@gmail.com
> >
> >> >>>> wrote:
> >> >>>> > I have routes defined using Java DSL and want to connect to the
> JVM
> >> >>>> > remotely to monitor the Camel Processors using jconsole.  Is
> there
> >> >>>> > something special that I must do in the Java DSL to enable remote
> >> JMX?
> >> >>>> >  Even when I'm on the same machine, jconsole can only connect
> when I
> >> >>>> choose
> >> >>>> > the PID.  The URL I am using to try and connect is:
> >> >>>> >
> >> >>>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
> >> >>>> >
> >> >>>> > I did notice in my Java DSL that the method
> >> >>>> >
> >> >>>> >
> >> >>>>
> >>
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> >> >>>> >
> >> >>>> > returns false.  I set it to true and get the same results.  What
> am
> >> I
> >> >>>> doing
> >> >>>> > wrong?  I am using Camel version 2.11.1.
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>> --
> >> >>>> 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
> >> >>>>
> >> >>>
> >> >>>
> >> >>
> >>
> >>
> >>
> >> --
> >> 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
> >>
>
>
>
> --
> 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
>

Re: Connecting remotely via JMX

Posted by Claus Ibsen <cl...@gmail.com>.
Before you call the .start() method on CamelContext, you can configure Camel.


On Thu, Aug 22, 2013 at 2:48 PM, Mark <el...@gmail.com> wrote:
> How is that done using Java DSL?  I am doing "mvn exec:java".
>
>
>
> On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <cl...@gmail.com> wrote:
>
>> Hi
>>
>> Did you configure the JMX settings before you started CamelContext?
>> This is needed for it to have effect.
>>
>>
>> On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <ph...@gmail.com> wrote:
>> > I "ported" my java DSL to Spring DSL and can connect using the JMX URI:
>> >
>> > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
>> >
>> > I did add the following line in the Spring DSL:
>> >
>> > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
>> >
>> > In the Java DSL I have the following:
>> >
>> > ManagementAgent agent =
>> > getContext().getManagementStrategy().getManagementAgent();
>> > if( !agent.getCreateConnector() )
>> > agent.setCreateConnector( true );
>> >
>> > agent.setUsePlatformMBeanServer(true);
>> > agent.setMBeanObjectDomainName("com.a.b.c");
>> >
>> > And it doesn't help me at all.
>> >
>> >
>> >
>> > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <ph...@gmail.com>
>> wrote:
>> >
>> >> Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
>> >>
>> >>
>> >>
>> >> On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com>
>> wrote:
>> >>
>> >>> I am running standalone.  Created the project using "mvn
>> >>> archetype:generate" and went through the steps to create a Java DSL
>> project.
>> >>>
>> >>>
>> >>>
>> >>> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <claus.ibsen@gmail.com
>> >wrote:
>> >>>
>> >>>> Are you running standalone or in some server/container? And if so
>> which
>> >>>> one?
>> >>>>
>> >>>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com>
>> >>>> wrote:
>> >>>> > I have routes defined using Java DSL and want to connect to the JVM
>> >>>> > remotely to monitor the Camel Processors using jconsole.  Is there
>> >>>> > something special that I must do in the Java DSL to enable remote
>> JMX?
>> >>>> >  Even when I'm on the same machine, jconsole can only connect when I
>> >>>> choose
>> >>>> > the PID.  The URL I am using to try and connect is:
>> >>>> >
>> >>>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
>> >>>> >
>> >>>> > I did notice in my Java DSL that the method
>> >>>> >
>> >>>> >
>> >>>>
>> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
>> >>>> >
>> >>>> > returns false.  I set it to true and get the same results.  What am
>> I
>> >>>> doing
>> >>>> > wrong?  I am using Camel version 2.11.1.
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> 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
>> >>>>
>> >>>
>> >>>
>> >>
>>
>>
>>
>> --
>> 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
>>



-- 
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

Re: Connecting remotely via JMX

Posted by Mark <el...@gmail.com>.
How is that done using Java DSL?  I am doing "mvn exec:java".



On Thu, Aug 22, 2013 at 2:08 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Did you configure the JMX settings before you started CamelContext?
> This is needed for it to have effect.
>
>
> On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <ph...@gmail.com> wrote:
> > I "ported" my java DSL to Spring DSL and can connect using the JMX URI:
> >
> > service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
> >
> > I did add the following line in the Spring DSL:
> >
> > <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
> >
> > In the Java DSL I have the following:
> >
> > ManagementAgent agent =
> > getContext().getManagementStrategy().getManagementAgent();
> > if( !agent.getCreateConnector() )
> > agent.setCreateConnector( true );
> >
> > agent.setUsePlatformMBeanServer(true);
> > agent.setMBeanObjectDomainName("com.a.b.c");
> >
> > And it doesn't help me at all.
> >
> >
> >
> > On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <ph...@gmail.com>
> wrote:
> >
> >> Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
> >>
> >>
> >>
> >> On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com>
> wrote:
> >>
> >>> I am running standalone.  Created the project using "mvn
> >>> archetype:generate" and went through the steps to create a Java DSL
> project.
> >>>
> >>>
> >>>
> >>> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <claus.ibsen@gmail.com
> >wrote:
> >>>
> >>>> Are you running standalone or in some server/container? And if so
> which
> >>>> one?
> >>>>
> >>>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com>
> >>>> wrote:
> >>>> > I have routes defined using Java DSL and want to connect to the JVM
> >>>> > remotely to monitor the Camel Processors using jconsole.  Is there
> >>>> > something special that I must do in the Java DSL to enable remote
> JMX?
> >>>> >  Even when I'm on the same machine, jconsole can only connect when I
> >>>> choose
> >>>> > the PID.  The URL I am using to try and connect is:
> >>>> >
> >>>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
> >>>> >
> >>>> > I did notice in my Java DSL that the method
> >>>> >
> >>>> >
> >>>>
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> >>>> >
> >>>> > returns false.  I set it to true and get the same results.  What am
> I
> >>>> doing
> >>>> > wrong?  I am using Camel version 2.11.1.
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> 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
> >>>>
> >>>
> >>>
> >>
>
>
>
> --
> 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
>

Re: Connecting remotely via JMX

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

Did you configure the JMX settings before you started CamelContext?
This is needed for it to have effect.


On Wed, Aug 21, 2013 at 7:07 PM, Tyler Durvik <ph...@gmail.com> wrote:
> I "ported" my java DSL to Spring DSL and can connect using the JMX URI:
>
> service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel
>
> I did add the following line in the Spring DSL:
>
> <camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />
>
> In the Java DSL I have the following:
>
> ManagementAgent agent =
> getContext().getManagementStrategy().getManagementAgent();
> if( !agent.getCreateConnector() )
> agent.setCreateConnector( true );
>
> agent.setUsePlatformMBeanServer(true);
> agent.setMBeanObjectDomainName("com.a.b.c");
>
> And it doesn't help me at all.
>
>
>
> On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <ph...@gmail.com> wrote:
>
>> Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
>>
>>
>>
>> On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com> wrote:
>>
>>> I am running standalone.  Created the project using "mvn
>>> archetype:generate" and went through the steps to create a Java DSL project.
>>>
>>>
>>>
>>> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <cl...@gmail.com>wrote:
>>>
>>>> Are you running standalone or in some server/container? And if so which
>>>> one?
>>>>
>>>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com>
>>>> wrote:
>>>> > I have routes defined using Java DSL and want to connect to the JVM
>>>> > remotely to monitor the Camel Processors using jconsole.  Is there
>>>> > something special that I must do in the Java DSL to enable remote JMX?
>>>> >  Even when I'm on the same machine, jconsole can only connect when I
>>>> choose
>>>> > the PID.  The URL I am using to try and connect is:
>>>> >
>>>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
>>>> >
>>>> > I did notice in my Java DSL that the method
>>>> >
>>>> >
>>>> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
>>>> >
>>>> > returns false.  I set it to true and get the same results.  What am I
>>>> doing
>>>> > wrong?  I am using Camel version 2.11.1.
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>
>>>
>>



-- 
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

Re: Connecting remotely via JMX

Posted by Tyler Durvik <ph...@gmail.com>.
I "ported" my java DSL to Spring DSL and can connect using the JMX URI:

service:jmx:rmi:///jndi/rmi://<hostname>:1099/jmxrmi/camel

I did add the following line in the Spring DSL:

<camel:jmxAgent id="jmx" mbeanObjectDomainName="com.a.b.c" />

In the Java DSL I have the following:

ManagementAgent agent =
getContext().getManagementStrategy().getManagementAgent();
if( !agent.getCreateConnector() )
agent.setCreateConnector( true );

agent.setUsePlatformMBeanServer(true);
agent.setMBeanObjectDomainName("com.a.b.c");

And it doesn't help me at all.



On Wed, Aug 21, 2013 at 10:09 AM, Tyler Durvik <ph...@gmail.com> wrote:

> Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.
>
>
>
> On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com> wrote:
>
>> I am running standalone.  Created the project using "mvn
>> archetype:generate" and went through the steps to create a Java DSL project.
>>
>>
>>
>> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <cl...@gmail.com>wrote:
>>
>>> Are you running standalone or in some server/container? And if so which
>>> one?
>>>
>>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com>
>>> wrote:
>>> > I have routes defined using Java DSL and want to connect to the JVM
>>> > remotely to monitor the Camel Processors using jconsole.  Is there
>>> > something special that I must do in the Java DSL to enable remote JMX?
>>> >  Even when I'm on the same machine, jconsole can only connect when I
>>> choose
>>> > the PID.  The URL I am using to try and connect is:
>>> >
>>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
>>> >
>>> > I did notice in my Java DSL that the method
>>> >
>>> >
>>> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
>>> >
>>> > returns false.  I set it to true and get the same results.  What am I
>>> doing
>>> > wrong?  I am using Camel version 2.11.1.
>>>
>>>
>>>
>>> --
>>> 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
>>>
>>
>>
>

Re: Connecting remotely via JMX

Posted by Tyler Durvik <ph...@gmail.com>.
Also, I am running JDK 1.7.0_25-b16 64-bit on Windows 7 Pro.



On Wed, Aug 21, 2013 at 9:47 AM, Tyler Durvik <ph...@gmail.com> wrote:

> I am running standalone.  Created the project using "mvn
> archetype:generate" and went through the steps to create a Java DSL project.
>
>
>
> On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <cl...@gmail.com>wrote:
>
>> Are you running standalone or in some server/container? And if so which
>> one?
>>
>> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com>
>> wrote:
>> > I have routes defined using Java DSL and want to connect to the JVM
>> > remotely to monitor the Camel Processors using jconsole.  Is there
>> > something special that I must do in the Java DSL to enable remote JMX?
>> >  Even when I'm on the same machine, jconsole can only connect when I
>> choose
>> > the PID.  The URL I am using to try and connect is:
>> >
>> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
>> >
>> > I did notice in my Java DSL that the method
>> >
>> >
>> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
>> >
>> > returns false.  I set it to true and get the same results.  What am I
>> doing
>> > wrong?  I am using Camel version 2.11.1.
>>
>>
>>
>> --
>> 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
>>
>
>

Re: Connecting remotely via JMX

Posted by Tyler Durvik <ph...@gmail.com>.
I am running standalone.  Created the project using "mvn
archetype:generate" and went through the steps to create a Java DSL project.



On Wed, Aug 21, 2013 at 9:43 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Are you running standalone or in some server/container? And if so which
> one?
>
> On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com> wrote:
> > I have routes defined using Java DSL and want to connect to the JVM
> > remotely to monitor the Camel Processors using jconsole.  Is there
> > something special that I must do in the Java DSL to enable remote JMX?
> >  Even when I'm on the same machine, jconsole can only connect when I
> choose
> > the PID.  The URL I am using to try and connect is:
> >
> > service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
> >
> > I did notice in my Java DSL that the method
> >
> >
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
> >
> > returns false.  I set it to true and get the same results.  What am I
> doing
> > wrong?  I am using Camel version 2.11.1.
>
>
>
> --
> 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
>

Re: Connecting remotely via JMX

Posted by Claus Ibsen <cl...@gmail.com>.
Are you running standalone or in some server/container? And if so which one?

On Wed, Aug 21, 2013 at 3:35 PM, Tyler Durvik <ph...@gmail.com> wrote:
> I have routes defined using Java DSL and want to connect to the JVM
> remotely to monitor the Camel Processors using jconsole.  Is there
> something special that I must do in the Java DSL to enable remote JMX?
>  Even when I'm on the same machine, jconsole can only connect when I choose
> the PID.  The URL I am using to try and connect is:
>
> service:jmx:rmi:///jndi/rmi://<computer name>:1099/jmxrmi/camel
>
> I did notice in my Java DSL that the method
>
> getContext().getManagementStrategy().getManagementAgent().getCreateConnector()
>
> returns false.  I set it to true and get the same results.  What am I doing
> wrong?  I am using Camel version 2.11.1.



-- 
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