Results 1 to 3 of 3

Thread: Programatically access MessageHandlers exposed via JMX

Threaded View

  1. #1

    Default Programatically access MessageHandlers exposed via JMX

    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

    Code:
    <jmx:mbean-export default-domain="com.irebalpoc.integration" server="mbeanServer"/>
    
    <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

    Code:
     <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
    Last edited by shashikanthb; Jun 25th, 2012 at 05:50 AM.
    Shashikanth

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •