none
MQ Correlation Through Orchestration In Biztalk (Without Using MQSeries Adapter) RRS feed

  • Question

  • Hello all,

    I am Sending a message to MQ and fetching the same message back to local folder.

    I am getting the appropreate response message but it is trying to receive

    the other messages also from Queue. (I am using Correlation Type for correlating)

    Does anybody have an Idea what would be the problem.

    Thanks in advanced..


    • Edited by _NiLeSh Wednesday, April 15, 2015 10:05 AM
    Wednesday, April 15, 2015 9:56 AM

Answers


  • how can I fetch the Exact message(which has sent) out of several messages already present in the Queue

    You can't, sorry, that is by design.  It is the expected behavior of any queuing technology.

    Queues work in a First In First Out (FIFO) pattern so you have to pop each message in the order it was pushed.

    If you need to selectively retrieve messages, a database is a better solution.

    • Proposed as answer by Singh AK Wednesday, April 15, 2015 9:24 PM
    • Marked as answer by Angie Xu Thursday, April 23, 2015 9:45 AM
    Wednesday, April 15, 2015 12:51 PM
    Moderator

All replies

  • Sorry, what is the 'other' message?
    Wednesday, April 15, 2015 10:24 AM
    Moderator
  • Other messages which are present already in that Queue.


    • Edited by _NiLeSh Wednesday, April 15, 2015 10:44 AM
    Wednesday, April 15, 2015 10:40 AM
  • Hello,

    Which adapter are you using to send/receive the messages from the MQ queue?

    When you configure a receive location with MQ or MQSC adapter, every message that exists in the queue will be consumed by the adapter. The correlation sets are checked once the messages are already in the message box.

    Regards.


    • Edited by ohawari Wednesday, April 15, 2015 10:54 AM
    Wednesday, April 15, 2015 10:54 AM
  • thanks Osman Hawari.

    I am using MQSeries Adapter for sending and receiving the message from MQ.

    how can I fetch the Exact message(which has sent) out of several messages already present in the Queue

    Is there any other way to do that.

    (I tried with using "amqmdnet.dll" in Expression shape that Scenario is different from My requirement.)



    • Edited by _NiLeSh Wednesday, April 15, 2015 11:08 AM
    Wednesday, April 15, 2015 11:03 AM
  • I don't know if there is a way to do that using the BizTalk adapter, because it consumes every existing message in the queue.

    If you know the MessageID property of the message sent to the queue, maybe you can develop a custom .NET component that looks for ths message in the queue and get it.

    Here you have a sample on how to receive/send messages to MQSeries queue in .NET

    http://www.codeproject.com/Articles/14009/Interfacing-with-IBM-WebSphere-MQ-formally-IBM-MQS

    In the sample code, they look for a message by the MessageID in the queue.

    Regards.


    • Edited by ohawari Wednesday, April 15, 2015 11:33 AM
    Wednesday, April 15, 2015 11:30 AM
  • The choice of adapter is irrelevant. In MQ there is a concept of message correlation which is handled through the use of a correlation ID on the message.

    Refer to https://msdn.microsoft.com/en-us/library/gg163665(v=bts.70).aspx for details.

    Regards.

    Wednesday, April 15, 2015 12:21 PM

  • how can I fetch the Exact message(which has sent) out of several messages already present in the Queue

    You can't, sorry, that is by design.  It is the expected behavior of any queuing technology.

    Queues work in a First In First Out (FIFO) pattern so you have to pop each message in the order it was pushed.

    If you need to selectively retrieve messages, a database is a better solution.

    • Proposed as answer by Singh AK Wednesday, April 15, 2015 9:24 PM
    • Marked as answer by Angie Xu Thursday, April 23, 2015 9:45 AM
    Wednesday, April 15, 2015 12:51 PM
    Moderator
  • As stated by John MQ works on FIFO model.

    You want to select only related message from message queue. Does it means you don't want to process other messages.if not in that case you have to look for other option. 

    If you have to consume all message at BizTalk end implement correlation pattern to correlate the message.


    Also can you let us know about your scenario or reason behind selective pick... It will help us to provide better solution to the current problem
    • Edited by Singh AK Wednesday, April 15, 2015 9:32 PM
    Wednesday, April 15, 2015 9:30 PM
  • I have to send a message to MQ(using MQSeries adapter) with setting correlationID property to the message and retrieve only that specific message from queue where several messages are already present based on that correlationID.
    I am trying to do this using correlation set.


    • Edited by _NiLeSh Thursday, April 16, 2015 11:46 AM
    Thursday, April 16, 2015 11:45 AM
  • To state again, you can't retrieve specific messages from a Queue, WMQ/MQS/MSMQ/JMS doesn't matter.

    Now, if you're trying just to Correlate that message back to your Orchestration, that's a different matter and is absolutely doable.

    How depends mostly on whether the WMQ Queues are one way or request-response.  In this case, WMQ can return messages out-of-order from the BizTalk app perspective.

    The details are in this article, the difference being which Context Properties you set and use for Correlation:

    https://msdn.microsoft.com/en-us/library/aa559871.aspx

    Thursday, April 16, 2015 1:45 PM
    Moderator