Introduction

The MSMQ adapter lets you use Message Queuing from BizTalk Server. Integrating Message Queuing technology with BizTalk Server enables applications that are running at different times to communicate across heterogeneous networks and systems that may be temporarily offline.

The MSMQ adapter features include the following:
  • Improved performanceSupport for multithreaded operations
  • Support for Message Queuing 4.0 features, including support for remote transactional reads and receiving from subqueues (available with Message Queuing 4.0).
  • Support for processing messages larger than 4 MB

Problem

I have spent 4hrs in configuring the BizTalk Dynamic SendPort for MSMQ. It would be easy to send the message using the specify later port. But to identify dynamic configuration for the send port, it is difficult.

How to configure a Dynamic MSMQ Send Port

The following are the configuration we need to have:

  • In the Construct shape we need to use below code to construct the MSMQ message:
msgPLM(MSMQ.BodyType)=8209;
msgPLM(MSMQ.Transactional) = false;
msgPLM(MSMQ.SegmentationSupport) = false;
msgPLM(MSMQ.UseAuthentication) = false;
msgPLM(MSMQ.TimeOut) = 5;
  • Then in the expression shape we need to define the transport type: 
prtSendToPLM(Microsoft.XLANGs.BaseTypes.Address) = PAL.EAI.BizTalk.Common.CustomComponents.SSOClientHelper.Read("PAL.EAI.BizTalk.PLM",strTableName);
prtSendToPLM(Microsoft.XLANGs.BaseTypes.TransportType) = "MSMQ";

I have stored my variable in SSO and I am reading the dynamic address from the SSO (global Variable).

The below is the MSMQ address:

strTableName= msmq://FORMATNAME:DIRECT=OS:<Queue Name>

This should be available for the MSMQ address: "msmq://FORMATNAME:DIRECT=OS:"

Sample Example:

strTableName= msmq://FORMATNAME:DIRECT=OS:Plrsg281\Productupdate

My queue name : Plrg281\Productupdate
This will help you to save your time.

Share your comments and let me know if you are facing any issue.

See Also

Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki