You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by asarkar <so...@outlook.com> on 2014/01/18 19:52:26 UTC

CXF JMX monitoring

I deployed a JAX-WS service and a Spring controller client to Jetty and hit
it with JConsole. 
On a Windows PC, I could see CXF MBeans but not any stats, even though I
configured CounterRepository as per the CXF documentation; my code 
CXFJMXConfig.java
<https://github.com/abhijitsarkar/java-ee/blob/master/webservices/jax-ws/jaxws-instrumentation/src/main/java/name/abhijitsarkar/webservices/jaxws/instrumentation/config/CXFJMXConfig.java> 
. 
On a Mac, I couldn't even connect using JConsole and, of course, it's the
same code. I'm seeing the following
suspicious messages in the console:

I'm starting to think that CXF does not support client side JMX monitoring
and I've doubts whether it even supports server side stats as claimed in the 
docs <http://cxf.apache.org/docs/jmx-management.html>  . 

[2014-01-18 13:51:03,992] [DEBUG] springframework.jndi.JndiTemplate -
Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]
[2014-01-18 13:51:03,992] [DEBUG] springframework.jndi.JndiPropertySource -
JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw
NamingException with message: null. Returning null.
[2014-01-18 13:51:03,992] [DEBUG] core.env.PropertySourcesPropertyResolver -
Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
[2014-01-18 13:51:03,993] [DEBUG] core.env.PropertySourcesPropertyResolver -
Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
[2014-01-18 13:51:03,993] [DEBUG] core.env.PropertySourcesPropertyResolver -
Could not find key 'spring.liveBeansView.mbeanDomain' in any property
source. Returning [null]



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JMX monitoring

Posted by asarkar <so...@outlook.com>.
I had opened a separate thread but now it seems they are related.

http://cxf.547215.n5.nabble.com/CXF-Tomcat-Spring-Java-config-td5738793.html



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738860.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JMX monitoring

Posted by Daniel Kulp <dk...@apache.org>.
On Jan 21, 2014, at 7:48 PM, asarkar <so...@outlook.com> wrote:

> I'm not sure what I did but I can now see both client and server stats in
> JConsole. The MBeans are named Performance.Counter.Client and
> Performance.Counter.Server respectively.
> Thanks for the help so far. I appreciate it.

Cool.   Not sure what you would have done either, but glad its working!   :-)

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: CXF JMX monitoring

Posted by asarkar <so...@outlook.com>.
I'm not sure what I did but I can now see both client and server stats in
JConsole. The MBeans are named Performance.Counter.Client and
Performance.Counter.Server respectively.
Thanks for the help so far. I appreciate it.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738939.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JMX monitoring

Posted by asarkar <so...@outlook.com>.
Is it possible to see both server and client stats if they're deployed on the
same server? I only see the server in JConsole.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738923.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JMX monitoring

Posted by asarkar <so...@outlook.com>.
Following Daniel's advice, I was able to see the client stats too. There's a
caveat (bug?) though: when client and service are deployed on the same
server, the stats just shows for the service. I had to deploy the client on
a separate server to be able to see the stats using JConsole.
If someone can comment on that, that'll be very helpful.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738864.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF JMX monitoring

Posted by Daniel Kulp <dk...@apache.org>.
On Jan 19, 2014, at 2:05 AM, asarkar <so...@outlook.com> wrote:

> OK, the stats do show up, AFTER a request has been made. However, I was
> correct in that client side monitoring isn't supported.

All the response time interceptors seem to be able to handle the client side OK.  The handleMessage methods all have code paths specifically for the client side.  We just don’t stick clients into the JMX hierarchy.

You can add the ResponseTimeFeature to the client which would keep track of the stats.  You may need to add a CounterRepository onto the Bus as well.   After that, you could do:

        CounterRepository cr = bus.getExtension(CounterRepository.class);

to get the repository and query stats and such.


Dan


> JConsole does work on Mac, with a security warning, however. I initially
> missed setting the JVM parameters without which it was not able to connect.
> The Spring messages are normal in debug mode...it's just Spring looking for
> a default profile.
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738792.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: CXF JMX monitoring

Posted by asarkar <so...@outlook.com>.
OK, the stats do show up, AFTER a request has been made. However, I was
correct in that client side monitoring isn't supported.
JConsole does work on Mac, with a security warning, however. I initially
missed setting the JVM parameters without which it was not able to connect.
The Spring messages are normal in debug mode...it's just Spring looking for
a default profile.



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMX-monitoring-tp5738787p5738792.html
Sent from the cxf-user mailing list archive at Nabble.com.