One of the most simple, elegant and useful business process “integration patterns” is the Message Broker Pattern. If you’ve ever needed to integrate a single internal process to multiple external processes in an efficient, flexible manner then BizTalk Server 2004’s implementation of this pattern is just the ticket!

Figure 1: BizTalk Server 2004 – Message Broker Implementation
"A message broker is a physical component that handles the communication between applications. Instead of communicating with each other, applications communicate only with the message broker. An application sends a message to the message broker, providing the logical name of the receivers. The message broker looks up applications registered under the logical name and then passes the message to them."
In BizTalk Server 2004, the Message Broker Pattern is easy to implement using multiple send ports, filters and maps as shown in Figure 1 above. The MessageBox database sends the message to the message recipients by using a subscription. To implement a subscription, the developer creates a send port that represents the recipient. A send port usually consists of a send pipeline for post-processing of the message, a send adapter that transmits the message to its destination, and a filter expression that defines whether the message will be sent through this send port. The filter expression is a query against the context properties of messages in the MessageBox database. A copy of the message is only sent to the send port if there is a match between the filter expression and the context properties.
Figure 2 shown below illustrates how the send port filter can be setup to match multiple context properties.

Figure 2: Filtering on Context Properties
We can also filter on different context properties for each send port created. In this scenario I am sending invoices to the same customer in different locations as well as to a different customer. This is done by filtering on different context properties or on a different number of context properties as shown in Figures 3 and 4 below.

Figure 3: Filtering on Additional Context Properties
Figure 4: Same Customer, Different Location
Since BizTalk Server 2004 also allows for different maps to be applied to each send port, the outbound message format can be "customized" as required. One customer may require an XML invoice while another requires a flat-file. BizTalk Server 2004 give you this flexibility without custom programming or through the use of an Orchestration.
Take Aways (Major Benefits):
- Message routing is determined at run time though the use of context properties. Send ports can be added or deleted at run time without affecting the source application or other send ports (destination applications).
- Messages transmitted through the message broker can be automatically tracked and archived. The tracking, archiving, and reporting functionalities are implemented only once, and they are shared by all applications that use the message broker. In BizTalk Server 2004, these functions are provided by Health and Activity Tracking (HAT).
- The messaging for an application is configured and managed from a central location and is not coded into the applications.
Posted
02-15-2005 9:24 PM
by
Jeff Lynch