NOTE: BizTalk 2013 now supports assigning Dynamic Send Ports to non-default hosts! Thus, the hacky workaround in this blog is no longer required for BizTalk 2013.
Before your read further – please note that the technique mentioned here for scaling out dynamic send ports is UNSUPPORTED by the Product Team. I’ve gotten this to work based on my understanding of the BizTalk Management Database and Message Box Database – however, my understanding could be wrong leading to issues in your scenario. Before executing these steps in a Production Environment, you should make sure that you have thoroughly tested this out in your test environment.
As far as Dynamic Send Ports are concerned, BizTalk has one big limitation – all the Dynamic Ports configured only execute on the Default Hosts for each Adapter. That is, if you have 15 Dynamic Send Ports, and on each Port you send messages for, say, the SQL, FILE and FTP Adapters, then all messages targeted for the FILE Adapter run on the same Host (whichever the default Send Handler is for the FILE Adapter), all the messages targeted for the SQL Adapter run on whichever host is the default Send Handler for SQL, and similarly for the FTP and all other Adapters. For Scale-Out, what you really want is to be able to say – for Dynamic Send Port 1 for the SQL Adapter, use Host 1, while for Dynamic Send Port 2 for the SQL Adapter, use Host 2.
I’ve written a small utility (.cs as well as .exe included in the .zip file) that allows you to do this. Here’s how you use the tool:
Create your Dynamic Send Port. Enlist it, but do not start it (let it remain in the Stopped State)
Run the tool, specify the name of the Port, the Adapter Type, and the new Host which you want to use.
Start your Dynamic Send Port.
For Dynamic Send Ports which already exist on your system:
Ensure that there are no active/queued/suspended/etc messages for this Port – in short, this Port should not be currently in use.
Stop the port (let it remain in the stopped state) – do not un-enlist it.
Run the tool.
Start the Port.
The tool accomplishes its objective by modifying the Subscription set up for the Dynamic Send Port, to point to the specified Host instead of the Default Host for that Adapter.
NOTE – If you ever delete a Handler / Host which was associated with a Dynamic Send Port using the utility above, then you will need to re-run the utility to specify a new Handler / Host for the specific Adapter for this Port. To help you with this, I’ve also written another tool which will inspect all the Dynamic Send Ports, and let you know if any port has been associated with an incorrect Host for a specific Adapter Type (incorrect meaning either the Host no longer exists, or there is no handler configured for that Adapter + Host combination).
You can download the utility here.