Announcement Announcement Module
Collapse
No announcement yet.
JMS Target Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS Target

    Hi, I have a Jms target which sends the messages to ApacheMQ queues and this is my configuration now.How can I now read these messages from the queue and reply back through the same channel adapter??Should I use JMS Gateway instead of jmstarget to stimulate the asynchronous messaging??
    Code:
    <channel-adapter id="jmsChannel" target="jmsTarget"/>
    <jms-target id="jmsTarget" connection-factory="connectionFactory" destination="destination"/>
        
    <beans:bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
      <beans:property name="brokerURL" value="tcp://localhost:61616" />
    </beans:bean>
    
    <beans:bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
       <beans:constructor-arg index="0" value="HelloJMS"/>
     </beans:bean>

  • #2
    Can you clarify a bit about what you mean here?:
    How can I now read these messages from the queue and reply back through the same channel adapter?
    Is some other system receiving from that queue and sending replies to the JMS Destination that is provided in each JMS Message's 'JMSReplyTo' property?

    If so, then the outbound-gateway is probably what you are looking for... in general, the channel-adapter is intended for unidirectional scenarios, and gateways are better suited for request/reply.

    Comment


    • #3
      Thanks for ur response.Well the whole system works now this way. A request comes to a Spring Webservice and the response from the webservice is sent to jms target(through a channel adapter) where is the destination is ActiveMQ queues. So now I want the jms target to be able to reply to these messages in queues.So from ur explanation jms target cannot do this sort of replying to messages specially cos of the channel adapter which is unidirectional??Is jms-gateway and outbound-gateway different?? Should I use jms-gateway instead of jms target or can use both??
      Last edited by ashleyvijay; Oct 31st, 2008, 07:23 AM.

      Comment


      • #4
        Sorry, but I still don't understand what you mean exactly. The outbound JMS channel-adapter (f.k.a. jms-target) simply *sends* a Message to a JMS destination. What do you mean by this?:
        I want the jms target to be able to reply to these messages in queues.
        Maybe a simple diagram would help. From your description, it sounds like you have the following (please confirm and/or modify):

        request -> Spring-WS endpoint -> Spring Integration channel-adapter -> JMS target -> JMS Queue

        Comment


        • #5
          Exactly! This is how it works now! which is a one way communication

          send request -> Spring-WS endpoint ->return response-> Spring Integration channel-adapter -> response sent as jms message->JMS target -> JMS Queue

          NoW I want to do this :a two way communication

          request -> Spring-WS endpoint -> response->Spring Integration channel-adapter -> JMS target -> JMS Queue ->
          sends response for the above Spring WS response through jms target back to weBservice ->JMS Target->Channel Adapter->Spring-WS endpoint

          Basically just like a chat communication! Is this possible?? May be u can modify if it wouldnt work
          Last edited by ashleyvijay; Oct 31st, 2008, 08:06 AM.

          Comment

          Working...
          X