0
votes

I have to send messages to IBM MQ by hitting a rest service. Below is the code I came up with, using Camel XML DSL.

<rest path="/basePath">
    <post uri="/path" consumes="application/xml" produces="application/xml">
        <to uri="ibmmq:QUEUE.NAME"/>
    </post>
</rest>

When I try to post the message, I get the following exception

org.apache.camel.RuntimeExchangeException: Failed to resolve replyTo destination on the exchange

Is the post method expecting response back from QUEUE, so that it can respond back to rest client? I only need the post service to reply with 200, if the message is successfully produced to QUEUE, 500 otherwise. How to solve this problem?

1
i'm also trying to implement IBM MQ Producer, if have the sample code in Github could you please link - Srikanth Janapati

1 Answers

1
votes

Pattern of your exchange is InOut so this is default behavior for your jms producer. Try change it for specific endpoint like this:

<to uri="ibmmq:QUEUE.NAME" pattern="InOnly"/>