PDA

View Full Version : Can we use JmsAdapters for messaging to remote systems



sureshsugunan
May 22nd, 2008, 05:49 AM
Hi

I am trying to send a message using Jmsadapters from one pc to other

in this manner

PC1
====

<jms-source channel="inChannel"
connection-factory="connectionFactory" destination="inQueue" />

<jms-target channel="inChannel"
connection-factory="connectionFactory" destination="inQueue" />

<beans:bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<beans:property name="brokerURL" value="tcp://localhost:61616" />
</beans:bean>

<beans:bean id="inQueue"
class="org.apache.activemq.command.ActiveMQQueue">
<beans:constructor-arg index="0" value="sample.queue" />
</beans:bean>



PC2
====

<jms-source channel="inChannel"
connection-factory="connectionFactory"
destination="inQueue"/>

<jms-target channel="inChannel"
connection-factory="connectionFactory"
destination="inQueue" />

<beans:bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<beans:property name="brokerURL" value="tcp://localhost:61616" />
</beans:bean>

<beans:bean id="inQueue"
class="org.apache.activemq.command.ActiveMQQueue">
<beans:constructor-arg index="0" value="sample.queue"/>
</beans:bean>



and sending message from PC1 using inChannel.send and in PC2 i am trying to receive message using inChannel.receive()

but not working please help me in this

Mark Fisher
May 22nd, 2008, 08:04 AM
Try removing the <jms-source/> from PC1's configuration and removing the <jms-target/> from PC2's configuration. When you send on PC1 it in turn sends to the JMS Target. When you receive on PC2, you will be receiving any Messages that have been received by the JMS Source.

Hope that helps.