Results 1 to 5 of 5

Thread: JMS Target

  1. #1
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Question 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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.

  3. #3
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Question

    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 at 07:23 AM.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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

  5. #5
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Question

    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 at 08:06 AM.

Posting Permissions

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