BizTalk Orchestration Port Bindings

By Rob Callaway

There are a lot of conflicting ideas out there regarding orchestration/logical port binding options for BizTalk server. In this post I want to provide a short description of each option and some best practices for use.

· Specify Now/Specify Later

These two are commonly referred to as Static bound ports. Both of these options will require that the orchestration port is associated with a physical port before the orchestration can be enlisted or started. The difference between the two lay in the creation of the physical port.

Specify Now requires that you specify the configuration of the physical port inside Visual Studio before the orchestration assembly is compiled. The physical port configuration is baked-into the assembly and will be created in the run-time environment automatically when the assembly is deployed. This is considered the worst port binding option as the created physical port will have the same configuration each time the assembly is deployed. Also, the name of the automatically created port is pretty ugly.

Specify Later is essentially the same in function, but the definition for the physical port is done exclusively in the BizTalk Server Administration Console. This provides more flexibility for port configuration, such as having multiple logical ports connected to the same send port or binding the logical send port to a send port group. This is the more acceptable form of static binding, but shouldn’t be overused especially in cases where subscribers are likely to change over time.

· Direct (Partner Orchestration)

This enables two different orchestration models to communicate with one another. The two orchestration ports must use the same port type. A send port in orchestration A will publish the message to the MessageBox and a receive port in orchestration B will subscribe to the message. The logical ports used for this type of communication will not be displayed in the orchestration configuration options in the BizTalk Server Administration Console. The biggest concern when using this form of binding is that the connection between the two orchestrations is static and can only be changed through modifications to each orchestration and then recompiling.

· Direct (MessageBox database)

This option provides the purest use of the publish/subscribe architecture. A logical receive port that uses this binding will have a subscription that includes only the MessageType used by the logical port operation and the conditions defined in the Filter Expression of an Activating Receive shape. This means that potentially ANY process can feed that orchestration.

A logical send port that uses this binding will publish the message and assume that there is at least one subscriber for it, but there could be many subscribers (i.e. orchestrations, send ports, or send port groups). Assuming that the right subscriptions exist; this type of send port could feed any other process.

Things to beware of: (1) Invisible Subscriptions – there’s no reliable way to see which processes will feed your orchestration or which processes your orchestration will feed; even across application boundaries. (2) “Infinite” loops –the orchestration publishes a message that creates a new instance of the same model, which will publish a message that creates a new instance of the same model…

Upsides of Direct bound to the MessageBox: (1) Very loosely-coupled design – there are no direct dependencies or static relationships between publisher and subscriber. (2) Rip and replace-ability – with appropriate project partitioning, an orchestration could be replaced without affecting upstream or downstream processes.

· Direct (Self-Correlating)

This option exists to enable “callbacks” to the parent orchestration from a child orchestration when the Start Orchestration shape is used. The parent passes an instance of the logical port as a parameter to the child orchestration during invocation; therefore providing the callback channel used by the child to send a message back to the parent later on in the process.

· Dynamic

This option only exists for send ports. Dynamic ports enable you to assign the address used for transmission of the message on an instance-by-instance basis. Typically an orchestration will include a resolution mechanism that determines the address used for that instance and assigns it to the message being published by the logical dynamic port. Logical dynamic ports are bound to physical dynamic ports which look at the previously set address information to know which adapter and address to use for transmission.

This seems like the coolest of the send options but I’ve seen a lot of overuse around the dynamic send ports (especially in the ESB toolkit). The line in the sand I use for deciding whether to use it or not is this: “Do I know the address before I get the message?” If yes, use static physical send ports and role links. If no, ask “Does the message tell me where to send?” If yes, uses dynamic send port. If no, sounds like a big problem.

The perfect example for using a dynamic send port is this: I have a form on the internet; people fill out the form and click Submit. The submitted message is received into BizTalk where some processing is done. At some point during that processing I need to create an email that is sent back to the person that submitted the original message. I can create an orchestration that looks at the email inside the submitted message and assigns it as the address used by that later send.

I hate to see addresses statically stored in custom databases or configuration files and then assigned as the address of a dynamic send port. It really just creates an extra layer of management.

I hope this helped you out on your future BizTalk endeavors, and always remember it doesn’t matter the binding option you use logical ports are only used for communication between orchestrations and the MessageBox database.

New BizTalk 2010 Training from QuickLearn

By Rob Callaway

Last year was a busy teaching year for me. I taught 35 BizTalk training courses to over 385 BizTalk developers and admins around the world. I received lots of great feedback from our students on ways to improve on our BizTalk Server training. This has resulted in complete rewrites of our BizTalk 2010 Developer Immersion and BizTalk 2010 Developer Deep Dive to make our BizTalk Server 2010 courses even better than ever. Here is a summary of what’s new in these two classes…

BizTalk 2010 Developer Immersion

This class is still intended for students who are new to developing BizTalk Server solutions. However, we have re-written all of the hands-labs to provide a less-traditional end-to-end scenario that I think students will really enjoy working with. We’ve also abandoned the use of step-by-step instructions in later labs. Essentially, we show students how to perform a task one time and then make the assumption that they will be able to repeat the process on their own as they progress through the course. This learning style changes the dynamic of the labs and requires students to apply what they have learned instead of just following written instructions. This makes the lab experience more challenging and much more rewarding.

Also, we have added optional challenge labs for students who want to dive deeper into more advanced BizTalk development topics during open lab time or by remoting into our lab environment after hours. For example, we have challenge labs for students who want to learn about EDI integration, how to process HIPAA healthcare documents, how to write application deployment scripts, and many more. We have also added new modules that cover tracking and troubleshooting of BizTalk run-time errors and BizTalk project planning and management.

BizTalk 2010 Developer Deep Dive

In the past we have had some problems with the leveling for the Deep Dive class. We kept getting too many students with little or no experience with BizTalk, who were not prepared for an advanced BizTalk course. As a result, students were often left behind or the instructor had to water down the training to meet their needs.

After much deliberation we finally decided that it was time to make the Deep Dive class exactly what it should be, very advanced! In this class we absolutely hit the ground running. There’s no time for “introduction to…” conversations. We assume that students already know everything that is taught in the BizTalk Immersion class and crank the dial to 11 with over 30 hands-on labs! We cover all the fun things in BizTalk like: custom components (pipeline and functoids), loosely-coupled orchestration patterns (call/start orchestration shapes, direct-bound ports), convoys, calling pipelines in orchestrations, failed message routing, and more. In fact, this is probably the most fun I’ve ever had while teaching a BizTalk class.

Whether you are new-to-product or a seasoned BizTalk developer, we have the best training to fit your needs. Check out 2011 training calendar for upcoming classes.

kick it on DotNetKicks.com