I have a send port going to a web service. At most, I want only 10 requests to be send to the web service at a time. Is this possible to do in biztalk? Hopefully through configuration?
3 Answers
There is a post by Richard Seroter that deals with this exact scenario.
You need to set the max connections in the btsntsvc.exe.config file:
<add address = "*" maxconnection = "2" />
Where you filter by IP address and set the maxconnections to what you require.
From the MSDN documentation on the HTTP Adapter it states that the address can be either a URL or an IP, an example config snippet is below:
<configuration>
<system.net>
<connectionManagement>
<add address = "http://www.contoso.com" maxconnection = "5" />
<add address = "http://www.northwind.com" maxconnection = "2" />
</connectionManagement>
</system.net>
</configuration>
You then need to turn on ordered delivery in the send port to ensure that the BizTalk side will not timeout to the limited number of connections.
While this looks like it does exactly what you want, I would also consider some sort of orchestration pattern to manage this, with a controler orchestration that limits the number of child "Send to the service" orchestrations that can run at one time. For me at least that would be a little bit easier to follow without needing external documentation.

- 32,624
- 10
- 90
- 127
-
Thanks. I've also heard you can create a new biztalk host, associate it to the soap adaptor, and use that host in the send port, and throttle the host via the host configuration. I haven't gotten this to work yet. – Jeremy Dec 15 '09 at 21:54
-
Yes - I've heard of that approach too - to me that feels to be the worst of the three though... can't really express why beyond it having a vague 'wrongness' to it. Host throttling is a perfectly valid use of hosts of course, but for a single web service... not so sure. – David Hall Dec 15 '09 at 22:10
-
So for the address, can I put something like "http://serverdnsname/webservice.asmx" as the value? is that valid? – Jeremy Dec 15 '09 at 22:27
-
I've added more detail to the answert about this - not sure of the exact form you would need to use to specify an asmx, whether you can go that low or if it is at the server name level. – David Hall Dec 15 '09 at 22:56
-
I'm not sure why you dislike the host settings option; never used it myself, but can't say it feels wrong to me. The only downside I can think of is the overhead of having an extra host for that reason alone, but that comes down to how busy it gets. (not that I disagree with the connection management route either, hence just a comment) – Yossi Dahan Jan 05 '10 at 16:02
-
Hi Yossi, I suppose my main dislike of using the host settings method comes down to it being a big hammer to use to solve a problem for a single web service. The scope of a host just feels bigger to me than that of an adapter. So nothing solid, just a feeling... perhaps it is just that the use of a host implies something more at a solution design level. – David Hall Jan 05 '10 at 22:27
-
Also be aware that the maxconnection is at the Host Instance level. So if you have multiple ports, and they aren't all on the same Host Instance, then they each get that many connections – Dijkgraaf Jul 06 '16 at 19:07
If you are using internal site shouldn't need to add following syntax
For example, your Webservice link is http://example.com/ms/sample.aspx add address = "http://example.com" maxconnection = "5"
A few things to consider about David Hall's answer
If you set ordered delivery on your send port you will greatly impact throughput, especially if you have a lot of Orchestrations making multiple calls to the same port as those Orchestrations will be Dehydrating and awaiting for their message to get a turn on the port. It also causes an issue if you have some instances that are request response from a web service and others which are high load and not urgent.
To avoid this we used a BizTalk Orchestration Throttling Pattern which was also from Richard Seroter originally where we are only allowing a certain number of the high volume Orchestrations to spin up at a time, and leaving some connections free for the low latency request/response calls.
Also the maxConnections setting is per Host Instance so you also either have to avoid having multiple send ports to the same server being on different Host Instances or if you have multiple BizTalk servers in a group and can't avoid it you have to set the maxConnections = TargetServermaxConnections / Host Instances

- 11,049
- 17
- 42
- 54