ESB Toolkit: Using the Broker Messaging Service in an Itinerary
아티클
Introduction
The Broker Service in the ESB Toolkit is a powerful Itinerary Service but it’s not heavily documented and therefore probably not often used. Which is a shame because it's very handy to make decisions within the itinerary.
Note:
No orchestration-based broker service is provided in the ESB Toolkit.
Steps
1. In Microsoft Visual Studio open or create a "BizTalk ESB Itinerary Designer" project.
2. In Solution Explorer, right-click the Itinerary project, point to Add, and then click New Itinerary.
3. Configure the properties of the itinerary.
In the Model Exporter drop-down list you can choose to export it to a file or to the Itinerary database.
In the Export Mode property drop-down list, click Strict.
4. Define the structure of the itinerary.
From the Toolbox, drag an On-Ramp model element to the design surface.
From the Toolbox, drag an Itinerary Broker Service model element to the designer, and then place it to the right side of the On-Ramp.
Figure 1. Toolbox
Configure the properties of the Broker Service.
In the Extender drop-down list, click Messaging Broker Extender.
In the Container drop-down list, expand the OnRamp, and then click Receive Handlers.
In the Service Name drop-down list, click Microsoft.Practices.ESB.Itinerary.Services.Broker.MessagingBroker.
Figure 2. Broker Service properties.
3. Right-click the Filter collection, and then click Add new Filter.
In the Properties window configure the properties.
Click the Filter Implementation drop-down list, and click XPath Filter.
Click the Expression property, and type a XPath filter that evaluates a promoted property:
Figure 3. Filter properties.
4. Add a new Filter with another XPath expression.
5. Right-click the Resolver collection of the BrokerService, and then click Add new Resolver.
In the Properties window, configure the properties.
In the Resolver Implementation drop-down list, click MessageContext Resolver Extension.
Figure 4. Resolver properties.
6. In the Toolbox, click Connector. Drag a connection from the OnRamp to the Broker Service.
7. From the Toolbox, drag an Itinerary Service model element to the design surface, and then place it next the Broker Service
In the ItineraryService Properties window, configure the following properties:
In the Itinerary Service Extender drop-down list, choose Messaging Extender or Orchestration Extender.
When necessary add a Resolver to the Service and modify the properties.
8. Add a new Itinerary Service that is needed for the other filter.
9. From the Toolbox, drag 2 Itinerary Out Port elements to right border of the Broker Service.
In the Properties window, configure the properties.
In the Filter drop-down list, select the Filter
In the Resolver drop-down list, select the Resolver.
Figure 5. Port properties.
10. In the Toolbox, click Connector. Drag a connection from the Itinerary Outport elements to the Itinerary Services.
Figure 6. Itinerary with Broker Service.
Testing
Once the itinerary is deployed to the Itinerary Store database, the solution is ready to be tested. Create a Receive Port and a Receive Location with the BizTalk Administration Console and drop a message in it.
Figure 7. Receive Location properties
Run DebugView to watch the trace output. Figure 8. DebugView