Hello Alex,
by enabling JMX in a Spring Integration app [1] you expose some components as MBeans, therefore you can access any of those by using the standard JMX API. However, Spring provides more convenient way to access MBeans using Spring JMX support[2]. For example, given the "monitoring" sample [3] you can expose the desired channel metric as follows:
Step 1 - Add "twitterChannel" MBean proxy
Code:
<bean id="twitterChannelMetrics" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
<property name="objectName" value="spring.application:type=MessageChannel,name=twitterChannel"/>
<property name="proxyInterface" value="org.springframework.integration.monitor.MessageChannelMetrics"/>
</bean>
Step 2 - Dep. inject the "twitterChannelMetrics" bean and call the desired method
Code:
...
@Autowired
private MessageChannelMetrics twitterChannelMetrics;
...
double tsls = twitterChannelMetrics.getTimeSinceLastSend();
...
Also, if you are interested check out Gary Russell's awesome webinar on monit. and manag. SI apps [4].
Cheers,
Michal
[1] http://static.springsource.org/sprin...mbean-exporter
[2] http://static.springsource.org/sprin...html#jmx-proxy
[3] https://github.com/SpringSource/spri...ate/monitoring
[4] http://www.youtube.com/watch?v=fkZcF47NRu0