I am trying to access the MessageHandler endpoint to start and stop the service via JMX. I have the below configuration in my context file. I am able to access the start/stop methods via JConsole.
I am also able to access the endpoint using MBeanServerConnectionFactoryBean from a spring based client.
Now i want to access the endpoint using MBeanProxyFactoryBean so that i can directly invoke the methods as if the bean was local. This doesnt seem to work.
Can you please see my configuation below and suggest whats wrong or what more needs to be done?
Server.xml
<int-jms:message-driven-channel-adapter id="jmsIn"
connection-factory="connectionFactory" concurrent-consumers="3" max-concurrent-consumers="5"
destination-name="emsQueue" acknowledge="transacted" channel="jmsInChannel"
extract-payload="false" />
<integration:service-activator id="serviceAct" input-channel="jmsInChannel" output-channel="fileNamesChannel"
ref="handler" method="process" />
Client.xml
<bean id="mBeanServerClient" class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean">
<property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:9004/jmxrmi" />
</bean>
<bean id="jmxClient" class="com.abc.test.IBalJMXClient">
<property name="connection" ref="mBeanServerClient" />
</bean>
<bean id="remoteJMSMBean" class="org.springframework.jmx.access.MBeanProxyFactoryBean">
<property name="objectName" value="com.abc.test:name=serviceAct" />
<property name="server" ref="mBeanServerClient" />
<property name="proxyInterface" value="com.abc.client.intf.IBalJMSController" />
</bean>
IBalJMSController is the interface in which i have defined start() , stop() and isRunning() methods so that i can access it from any class.
When i try to test it i get invocation exception. Any suggestion will be much appreciated