none
MSMQ how to setup correlation? RRS feed

  • Question

  • HI all,

    I'm tryint to set up communication between two different BizTalk instances via MSMQ. Now I'm failing with the correlation part of MSMQ.

    I'm trying to initialize correlation from orchestration (MSMQ.CorrelationId), but failing with that. Now on my orchestration, after receive shape, I'm copying (message assignment, basically copying) the message to another message, setting the correlation value and sending created message to MSMQ. However that is not working, and I'm receiving this error from send por to queuet:
    "The following exception: "Index and length must refer to a location within the string.
    Parameter name: length" was thrown by MSMQ. This can be caused by a badly formatted queue path, if this is a Dynamic Send check the URI in the message."

    Could someone kindly tell me a bit more detailed steps (meaning what properties to use to succesfully initialize MSMQ correlation set) to get this working? When this orchestration is working, I'll have another orchestration that changes message, and it needs to set the same properties to message so that the correlation works...

    Any help would be highly apreciated!

     

    Saturday, November 14, 2009 9:26 PM

All replies

  • Hi,

    Are you setting something like MsgResponse(MSMQ.CorrelationId)=MsgRequest(MSMQ.Id) ??

    Have a look at the created msg in bts admin console and see what is actually in the Msg Context.

    If you have 2 bts instances you're wanting to correlate, then have you considered using BTS Correlation - e.g. correlationtype + correlationsets based on any piece of data that flows between the two systems. This technique certainly opens up greater flexibility than just using MSMQ.

    (Your bts correlation then becomes transport independant)

    Let me know how you go.

    Cheers,

    Mick.

    Mick Badran - http://blogs.breezetraining.com.au/mickb
    Sunday, November 15, 2009 5:37 AM
  • Hi,

    This problem comes before I can actually see the message(s) from BTS Admin, I'm not able to send to MSMQ in the first place, when initializing MSMQ.CorrelationId.

    In my 1st orchestration (let's say it is in instance 1) I'm trying to initialize the correlation using messageRequest(MSMQ.CorrelationID)="somethingrandom", but it fails with the text The following exception: "Index and length must refer to a location within the string. Parameter name: length" was thrown by MSMQ. This can be caused by a badly formatted queue path, if this is a Dynamic Send check the URI in the message." So I'm not even able to pick up that message to orchestration in instance 2.

    I changed the correlation to use MSMQ.Label, and then it works. I would like to undestand why I'm not able to set up the correlation value to MSMQ.CorrelationID and use that to correlate?

    I agree with you Mick about using more generic compared to transport specific. However, I didn't find BTS.CorrelationType on my solution (using BizTalk 2006 R2). Was that what you meant?

    Sunday, November 15, 2009 6:47 AM