There was a message at the Codeplex site from someone having issues doing a simple “receive file from folder, do dynamic endpoint resolution and deliver message”. I threw together a little sample showing how this works, and blogged about it in case others need this too.
The moving parts involved are:
- receive location using the ItineraryReceivePassthrough pipeline
- dynamic send port using the ItinerarySendPassthrough pipeline
How it works:
- the message is received
- the ESB Dispatcher Disassembler calls the Resolver specified in the Endpoint (in this sample, the business rules engine, see below)
- the Resolver invokes the rules policy
- the AdapterProvider framework sets appropriate outbound adapter information
- the message hits the MessageBox
- a send port subscribes to all messages from that specific receive location
- the message is delivered
The receive configuration looks like this:
(full endpoint value is “BRE:\\policy=Microsoft.Practices.ESB.Test;version=;useMsg=;MessageExchangePattern=;”)
Next, using the BizTalk Admin tool, right-click your test application and add a reference to the Microsoft.Practices.ESB BizTalk application. That way you’ll be able to access the resources it contains, including the pipelines. We will need this for the next step.
The send side looks like this (note that there are no values set in the per-instance properties):
Then, of course, we need a filter condition to link them together:
The ultra-complex rules policy 🙂 looks like this: