Direct bound ports are logical one-way or two-way ports that you can use inside your orchestration that are not explicitly bound to physical ports. This will allow you to have different communication patterns among your services.
There are three types of direct bound ports that you can choose as the Partner Orchestration Port:
Today we are going to talk about Message Box direct bound ports.
Message Box direct bound ports allow you to implement publish-subscribe design patterns. Messages sent by an Orchestration to a Message Box direct bound port are published to the BizTalk Server Message Box database without any explicit intent of the message recipients.
Recipients of the message can be any service that can subscribe to messages which include:
If you don’t add any filter criteria to the activating receive shape connected to a Message Box direct bound port, then the subscription will be:
http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType == <SchemaMessageType>
For any published message, there can be any number of subscribers for that message. If no subscribers are interested in the message when you publish it, a persistence exception is thrown with an inner exception of Subscription not found.
Another thing you need to be aware of is that, inside an orchestration, you can create a Message box direct bound receive port that does not have a filter explicitly, and in this case, it will receive any message types. How do you accomplish that?
If inside the Orchestration you specify that the Message Type associated with that Message Box direct bound receive port to be XmlDocument then this will be a type-agnostic port. Type-agnostic ports will accept any message type.
If using Message Box direct bound ports has its advantages, like creating loose-coupling solutions. But it also has its disadvantages that you need to be aware especially:
For those reasons, use this functionality carefully!
To configure a Message Box direct bound port, select Routing between ports will be defined by filter expressions on incoming messages in the Message Box database in the Port Configuration Wizard.
You can find a sample solution of Message Box direct bound ports on my GitHub here: