I´m using the MQ Adapter to put/read messages to/from queues.
I´m having trouble mapping 2 messages (request & response).
Example:
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.
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.
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