Announcement Announcement Module
Collapse
No announcement yet.
Help with jms reply Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with jms reply

    Hi ppl,

    I'm trying to implement a simple http to jms queue bridge with a little message transformation. My current configuration is:

    PHP Code:
    <http:inbound-gateway id="dplatform-gateway"
                          
    request-channel="gateway.request.channel"/>
        
    <
    jms:outbound-gateway request-destination="engine.input.queue"
                          
    request-channel="gateway.request.channel"
                          
    message-converter="gateway-message-converter"/>
                             
    <
    beans:bean id="gateway-message-converter" 
                
    class="com.cortex.dplatform.queue.gateway.GatewayMessageConverter" />

    <
    channel id="gateway.request.channel" /> 
    My problem is that I don't want the reply (back to the http request) coming from the subscribers of engine.input.queue. Instead, I would like to send a quick reply telling if the message was sent to engine.input.queue (replying with HTTP 200) or if there was a problem (replying with HTTP 500). But I can't find a way to do this.
    This current configuration only gives my a HTTP 500 with and exception telling that there was a jms reply timeout. Any clue anyone?

    Thanks in advance,
    Thiago Souza

  • #2
    I think you should try using an http "inbound-channel-adapter" instead of the gateway. That will act as a single-direction async request handler.

    Comment


    • #3
      Hi,

      Thanks for your reply. Could you please provide me an example? How would it be in my case? (Considering the message transformation)

      Regards,
      Thiago Souza

      Comment


      • #4
        You should be able to simply change from:
        Code:
        <http:inbound-gateway id="x" request-channel="y"/>
        to:
        Code:
        <http:inbound-channel-adapter id="x" channel="y"/>

        Comment


        • #5
          Hi,

          It worked like a charm. I've got a better understanding of the request-response nature of gateways and so I've switched from jms:outbound-gateway to jms:outbound-channel-adapter, but to do so I had to wrap the message converter in a JmsTemplate and it made me wonder why doesn't channel adapters support message converters directly?

          Regards,
          Thiago Souza

          Comment


          • #6
            You have a good point. Feel free to open a JIRA issue requesting support for the "message-converter" attribute on the JMS outbound-channel-adapter just like we already support with the JMS outbound-gateway.

            Thanks,
            Mark

            Comment

            Working...
            X