Announcement Announcement Module
Collapse
No announcement yet.
Issue with <int-amqp:outbound-channel-adapter> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with <int-amqp:outbound-channel-adapter>

    Took spring-integration-amqp from the sandbox for a test drive.
    I was able to get the amqp:inbound-channel-adapter to work but I'm having issues with the amqp:outbound-channel-adapter.

    Here is my configuration (ommiting rabbit config section):

    HTML Code:
    <int-amqp:outbound-channel-adapter channel="amqpOutChannel"
                                       exchange-name="hello.world.queue"
                                       routing-key="hello.world.queue"
                                       amqp-template="rabbitTemplate"/>
    
    <int:channel id="amqpOutChannel"/>
    
    <int:gateway id="messageSender" 
                 default-request-channel="amqpOutChannel" 
                 service-interface="org.spring.integration.amqp.MessageSender"/>
    
    <int-amqp:inbound-channel-adapter channel="amqpInChannel"
                                      queue-name="hello.world.queue"
                                      connection-factory="connectionFactory"/>
       
    <int:channel id="amqpInChannel"/>
    
    <int:service-activator id="messagePrinter" 
                           ref="messagePrinterService" input-channel="amqpInChannel" 
                           method="printMessage"/>
        
    <bean id="messagePrinterService" class="org.spring.integration.amqp.MessagePrinterService"/>
    I know the inbound-channel-adapter is working because when I send messages to the queue they are being picked up and the service activator triggered.

    When I send a message through the message gateway I expect the outbound-channel-adapter to pick it up and send it to the queue but this is NOT happening.

    If I replace the outbound-channel-adapter with a <stdout-channel-adapter> I can see the message being printed in the console.

    So, the message is making it to the "amqpOutChannel" but for some reason the <amqp:outbound-channel-adapter> seems to not pick it up or some how the message is not making it to the queue because when I pull from the queue I get "null".

    Anyone experienced something similar? Am I doing something wrong or missing something in the configuration?

    Thanks,

    Nick.

  • #2
    If you are trying to send directly to the Queue via the default no-name Exchange, then just leave out the "exchange-name" attribute.

    Let us know if that helps.
    -Mark

    Comment


    • #3
      Hi Mark,

      Thanks for the comment. You were absolutely right, newbie mistake . I was sending the message out to the "hello.world.queue" exchange when there was no such a exchange configured.

      I was able to get the example working by omitting the exchange property (as you pointed out) in the <amqp:outbound-channel-adapter>. I also configured an exchange and then used the exchange property and it worked as well.

      Now the problem I have is that the message is not being converted back to a String and I'm getting the byte array from the <amqp:inbound-channel-adapter>.

      Of course, it works as expected when I use the "rabbitTemplate" direclty and do convertAndSend() and receiveAndConvert().
      But is not working in a similar manner when I use the <amqp:inbound-channel-adapter>.

      Am I missing something in the configuration? Do I need to register a converter? I understand that a SimpleMessageConverter will be used by the "rabbitTemplate" by default.

      Thanks,

      Nick.

      Comment


      • #4
        I encountered this same issue recently, and so I just now pushed a change that might solve your problem. Can you pull and try again?

        We'll add a configurable option for the converter, but for now, I at least have the SimpleMessageConverter within the AmqpInboundEndpoint.

        Comment


        • #5
          Hi Mark,

          Quick question, I've noticed that spring-integration-amqp is in both, in the sandbox, and as branch of spring-integration.

          Are these two sync up or should I favor one over the other?

          Thanks,

          Nick.

          Comment


          • #6
            This is the one that is being actively developed and will eventually be moved over to the HEAD (for Spring Integration 2.1):
            http://git.springsource.org/spring-integration/sandbox

            Comment


            • #7
              Yeap, that worked

              Thanks a lot for the support!!!

              Comment


              • #8
                No problem. Thank *you* for being willing to live on the cutting edge. This is the kind of feedback that really helps us.

                Comment

                Working...
                X