MQ Adapter (map request to response)


I´m using the MQ Adapter to put/read messages to/from queues.
I´m having trouble mapping 2 messages (request & response).

If I put a message on queue A, how should I do to get the correct answer from the queue B (all answers are put there). If I don´t set any criterias on the get service, I just get the message that was first placed (FIFO) on the queue (B).

I tried playing around with the MsgId and CorrelId header parameters, but without success.

Any help is appreciated.



I have exactly the same problem
Do you fix it?
Can anyone Help Please?


I didn´t solve it.
However, I used a requestReply service instead which worked as a workaround since I allways expects an answer within 5 seconds.

The requestReply service automatically returns the correct message.


I don’t think that’s a workaround. I think that’s one legitimate way to do it.

The other is to track the request IDs, and other data needed for response processing, that are sent out in some way (DB table perhaps). Then when processing the response queue (async) you look up the request ID to match the response with the proper request.

Raemon: true - can´t argue about that :slight_smile:

In my case I just wanted a request/response function, and when I failed using notifiers (due to the issue in question) I ended up using the built-in mq request/reply function - which acually was alot easier.

tmac: If the request/reply function does not suit your solution, I would probably try something similar to what Raemon just suggested (assuming the back-end system can return the request id).

If you have a database with envelopes (from published documents waiting for replies) you can use the envelope tag or some other ID as a request id, and then use the same (from the reply) to retrieve the correct envelope before publishing you reply :cool:

Best regards,

please, Can you explain me how to use and parameter the request/reply functionality?

Thanks in advance