spring jms - How to listen jms-queue from remote server -
i have implemented jms queue , listner in spring application. not able listen jms queue remote system. have configured queue in server application util-sevice.xml file.
<bean id="jnditemplate" class="org.springframework.jndi.jnditemplate"> <property name="environment"> <props> <prop key="java.naming.provider.url">http-remoting://182.18.177.115:80</prop> <prop key="java.naming.factory.initial">org.jboss.naming.remote.client.initialcontextfactory </prop> <prop key="java.naming.security.principal">user</prop> <prop key="java.naming.security.principal">pwd</prop> </props> </property> </bean> <bean id="connectionfactory" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jnditemplate"> <ref bean="jnditemplate" /> </property> <property name="jndiname" value="jms/remoteconnectionfactory"> </property> </bean> <bean id="credentialsconnectionfactory" class="org.springframework.jms.connection.usercredentialsconnectionfactoryadapter"> <property name="targetconnectionfactory" ref="connectionfactory" /> <property name="username" value="use" /> <property name="password" value="pwd" /> </bean> <bean id="genricdbsyncdestination" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jnditemplate" ref="jnditemplate" /> <property name="jndiname" value="java:/jms/queue/genricdbsyncqueue" /> </bean> <bean id="genricdbsynctemplate" class="org.springframework.jms.core.jmstemplate"> <property name="connectionfactory" ref="credentialsconnectionfactory" /> <property name="defaultdestination" ref="genricdbsyncdestination" /> </bean>
standalone-full.xml in remote server
<jms-queue name="genricdbsyncqueue"> <entry name="jms/queue/genricdbsyncqueue"/> <entry name="java:jboss/exported/jms/queue/genricdbsyncqueue"/> </jms-queue>
and local system spring application util-service.xml config file listening queue
<bean id="genricdbsynclistener" class="com.ayotta.genericdbsync.genericdbsyncconsumer" /> <bean id="jnditemplate" class="org.springframework.jndi.jnditemplate"> <property name="environment"> <props> <prop key="java.naming.provider.url">http-remoting://182.18.177.115:80</prop> <prop key="java.naming.factory.initial">org.jboss.naming.remote.client.initialcontextfactory </prop> <property name="username" value="use" /> <property name="password" value="pwd" /> </props> </property> </bean> <bean id="connectionfactory" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jnditemplate"> <ref bean="jnditemplate" /> </property> <property name="jndiname" value="jms/remoteconnectionfactory"> </property> </bean> <bean id="credentialsconnectionfactory" class="org.springframework.jms.connection.usercredentialsconnectionfactoryadapter"> <property name="targetconnectionfactory" ref="connectionfactory" /> <property name="username" value="use" /> <property name="password" value="pwd" /> </bean> <jms:listener-container connection-factory="credentialsconnectionfactory" concurrency="1" acknowledge="auto" destination-type="queue"> <jms:listener destination="genricdbsyncqueue" ref="genricdbsynclistener" method="onmessage" /> </jms:listener-container>
how listen remote jms queue local system application
Comments
Post a Comment