Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
8 replies Latest Post - ‏2013-07-22T23:42:46Z by T736_Mayur_Garg
T736_Mayur_Garg
T736_Mayur_Garg
16 Posts
ACCEPTED ANSWER

Pinned topic Multiple Response from MQ backend for 1 Request msg

‏2012-11-01T22:18:38Z |
I have a requirement where i need to drop 1 Request message on the queue and am expecting multiple responses for the same request (correlation Id would be same in all Response msgs corresponding to that request). I need to collate the responses and send a consolidated response back to consumer.

Any pointers on how to read/wait for multiple responses from MQ backend would be appreciated.

Thanks,
Mayur Garg
Updated on 2012-11-07T21:00:22Z at 2012-11-07T21:00:22Z by T736_Mayur_Garg
  • devdp
    devdp
    37 Posts
    ACCEPTED ANSWER

    Re: Multiple Response from MQ backend for 1 Request msg

    ‏2012-11-06T11:22:34Z  in response to T736_Mayur_Garg
    Hi,
    Have you got the solution for this?
  • SystemAdmin
    SystemAdmin
    6772 Posts
    ACCEPTED ANSWER

    Re: Multiple Response from MQ backend for 1 Request msg

    ‏2012-11-06T13:22:04Z  in response to T736_Mayur_Garg
    Mayur..I don't think this is doable. MQ Request and response is one logical unit of work. The client does a MQPUT and does a MQGET with wait till the timeout period. The GET expires when either the response is received or the timeout is reached. The individual thread will end there.

    Nilesh
    • T736_Mayur_Garg
      T736_Mayur_Garg
      16 Posts
      ACCEPTED ANSWER

      Re: Multiple Response from MQ backend for 1 Request msg

      ‏2012-11-07T21:00:22Z  in response to SystemAdmin
      I dont have a solution yet.
      And yes, this doesn't seem to be a regular requirement.

      For now, I am thinking in this drection -
      To have a Request service as Fire and Forget and then have a Response service with MQ Frontend listening on the Reply Queue and try to do consolidation of messages(which are actually responses) with similar correlation id in this service. Not sure if I will be able to do that. Will be trying this soon.

      Thanks,
      Mayur
  • serioussaumav
    serioussaumav
    2 Posts
    ACCEPTED ANSWER

    Re: Multiple Response from MQ backend for 1 Request msg

    ‏2013-07-18T21:46:32Z  in response to T736_Mayur_Garg

    I had done this years back using Java. There it was simple though. I place a request on the request queue and wait multiple times for the response on the same correlation ID.

    Now we are planning to move the same service to datapower and while searching found this thread. Guess there is no solution found for this on this thread yet.. Guess I'll look around a bit more.

    • Daniel Shih
      Daniel Shih
      6 Posts
      ACCEPTED ANSWER

      Re: Multiple Response from MQ backend for 1 Request msg

      ‏2013-07-19T10:16:00Z  in response to serioussaumav

      Perhaps you can try this out:

       

      Retrieving responses by message ID or by correlation ID:

      http://pic.dhe.ibm.com/infocenter/wsdatap/v5r0m0/index.jsp?topic=%2Fcom.ibm.dp.xb.doc%2Fintegratingwithmq33.htm&resultof%3D%2522%2563%256f%2572%2572%2565%256c%2561%2574%2569%256f%256e%2522%2520%2522%2563%256f%2572%2572%2565%256c%2522%2520%2522%2569%2564%2522%2520

       

      Daniel

      • serioussaumav
        serioussaumav
        2 Posts
        ACCEPTED ANSWER

        Re: Multiple Response from MQ backend for 1 Request msg

        ‏2013-07-19T20:27:31Z  in response to Daniel Shih

        Yes thts a good way to retrieve on corr ID. Although setting on GUID wouldn't help as corr ID is dynamic and separate for each request. I think there should a corresponding dp variable so that it ca be set for each request. let me look for it.

        • NILAY97
          NILAY97
          210 Posts
          ACCEPTED ANSWER

          Re: Multiple Response from MQ backend for 1 Request msg

          ‏2013-07-21T07:53:13Z  in response to serioussaumav

          Hi All,

          Went about reading your posts and the requirement is simple here to have the same CorrelId for all the Ressponses rcvd for a single message placed on the queue and then collate the responses and send back.

          I do not think you can do this. Iam not sure if DataPower will save the Responses. Once DP will receive the response, it  will end the HTTP(s) Connection there itself.

          I guess this can be achieved through MessageBroker, as there you can save the responses in Orchestration Context. Will try to search for this on DataPower.

          Do let me know if you guys find something on this.

          • T736_Mayur_Garg
            T736_Mayur_Garg
            16 Posts
            ACCEPTED ANSWER

            Re: Multiple Response from MQ backend for 1 Request msg

            ‏2013-07-22T23:42:46Z  in response to NILAY97

            All,

            I was able to implement this in Datapower.

            Implementation- We did  a loop in xsl to pick up the response from MQ on a Corelation ID. We  had a FIXED Count of responses that will come back with same corellation id - so it was easier to put in a loop.

            I am sure suggestion from 'danielshih ' would also work but again putting it in loop to pull all responses with that corelation Id will be an effort.

            [Do reach out if someone needs to the code - Its pretty easy though.]