Low latency optimization of BizTalk server has been described here . This blog will describe a ‘real world‘ optimization of the following interchange;
- A two way WCF basic HTTP receive location
- The request is consumed by an orchestration.
- The request is then sent to two way WCF custom SQL send adapter via a XML transmit pipeline.
- The response from the two way WCF custom SQL send adapter is consumed by the orchestration via a XML receive pipeline.
- The WCF custom SQL adapter response is then mapped to WCF basic HTTP response required for the two way WCF basic HTTP receive location.
- Finally the orchestration sends the response via PassThruTransmit pipeline to the two way WCF basic HTTP receive location.
The average message latency for this interchange is 1.484 seconds as shown in the table below in column 2. (N.B. All numbers in this post are from a development VM and better numbers should be observed in a production environment. We are only compating apples with apples in this post.)
How can we improve this? The first thing to do is to remove orchestration so that we have a messaging only scenario. To do this ;
- The XML transmit pipeline has to be changed a custom receive pipeline that promotes BTS.Operation = “sp_GetQuoteDetails” to the context of the incoming message. This required or else the send port will not understand the required action.
- The two way WCF custom SQL send adapter must be bound to the two way WCF basic HTTP receive location in some way. You can use a filter on BTS.Receive port name or BTS.Operation.
- The map between the WCF custom SQL adapter response and the WCF basic HTTP response is place on the inbound map property of the two way WCF custom SQL send adapter.
Now the average message latency for this interchange is 0.922 seconds as shown in the table below in column 3.
Can we improve this further? Yes, if you change the send pipeline on the two way WCF custom SQL send adapter from a XML receive pipeline to a PassThruTransmit pipeline the average message latency for this interchange is now 0.771seconds as shown in the table below in column 4.
Finally what happens if tune the BizTalk server for low latency? the average message latency for this interchange is now 0.533 seconds as shown in the table below in column 5.
In summary when want to improve message latency;
- first think about whether you really need to use an orchestration
- secondly place the maps on ports rather than in an orchestration if you can.
- thirdly think about what sort of pipeline you need on your ports.
- finally tune your BizTalk server for low latency.
|Message latency ( seconds)|
|Send pipeline on send port||XML Transmit||XML Transmit||PassThrough transmit||PassThrough transmit|
|BTS tuned for low latency||No||No||No||Yes|