locked
Set up asyncronous correlation to MSMQ / Dynamics AX2012 RRS feed

  • Question

  • Hi Pros,

    I am using the MSMQ-Adapter to send an async. message to Dynamics AX2012. The message is processed by AX and the response is put to an outbound MSMQ directory.

    BizTalk receives the response but i have problems setting up a working correlation so that the Orchestration can go on processing with the response message. I am currently getting a Routing-Failure.

    I tried MSMQT.CorrelationId for the correlation without success. Is there anything in Dynamics AX I have to set up to make this work?

    Monday, April 20, 2015 9:36 AM

Answers

All replies

  • Hi,

    I believe that the problem you are facing is due to that the response message that you are receiving from Dynamics doesn't contain the correct value set in the context property MSMQT.CorrelationId that you are using in the correlation. You can check it inspecting the context properties of the message received from Dynamics.

    I think that you will probably need to get the MSMQT.CorrelationId value from the request message received from the msmq location in Dynamics, and write this value back to the response message that is delivered.

    Regards.




    • Edited by ohawari Monday, April 20, 2015 10:38 AM
    Monday, April 20, 2015 10:35 AM
  • Are you calling Dynamics AX using a request-response port??

    If yes then if you want to subscribe the response received from two way send port, it can be done by creating a send port with Filter as - BTS.SPName =<Name of the 2way Send port>.

    Whenever response message is published by 2 way send port, it publishes the SPName property which can be used for fetching the response message.

    Check the below blog- HOW TO SUBSCRIBE THE RESPONSE MESSAGE OF 2-WAY (REQUEST- RESPONSE) SEND PORT


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, April 20, 2015 11:02 AM
  • "believe that the problem you are facing is due to that the response message that you are receiving from Dynamics doesn't contain the correct value set in the context property MSMQT.CorrelationId that you are using in the correlation"

    Yes that is my Problem.

    The correlationId is set and promote in the request Message but it is missing in the response. 

    Dynamics AX issue?

    Monday, April 20, 2015 12:11 PM
  • No it is asynchronous so I am using one-way ports and the orchestration dehydrates while the request is processed by AX.
    Monday, April 20, 2015 12:13 PM
  • In a way yes, it is a dynamics issue. Does Dynamics in any form guarantee that the response will contain the correlation token back?

    But there are other ways to correlate the response back in BizTalk. These are called correlation sets (refer https://msdn.microsoft.com/en-us/library/aa560163.aspx?f=255&MSPPError=-2147217396) and how to use them in orchestrations (refer https://msdn.microsoft.com/en-in/library/aa578692.aspx)

    This way you're not dependent on the external applications having to honor the correlation token. You define how to correlate using the data in the request/response.

    Regards.

    • Marked as answer by Angie Xu Monday, April 27, 2015 6:39 AM
    Monday, April 20, 2015 2:24 PM
  • Hi Trombone,

    As you are using One Way Send Port you will have to specifically maintain/manage Correlation between the outgoing and incoming message. You can do that by initializing any Correlation Set and later following the same on next receive shape.

    For this either you will have to identify some common element between the outgoing and incoming message or create something like explained in below.

    Please check the below example- Implementing Correlation (Property Promotion) without any Common Element


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, April 20, 2015 3:50 PM
  • It worked correlating on the RequestMessageId as described here:

    https://technet.microsoft.com/en-us/library/hh352300.aspx

    It is important to use the XMLReceive Pipeline and to install the DynamixAx5.Envelope Schema to make this work correctly.

    Wednesday, April 29, 2015 2:10 PM