Adjusting Adapter Performance

This topic provides suggestions on improving adapter performance by throttling the number of messages handled by the adapter.

Outbound adapter throttling

You can handle throttling the number of messages sent from a custom send adapter in numerous ways depending on whether you control the source code for the adapter.

If you control the source code for the adapter, you can determine from heuristics the maximum number of messages that you want to have in the queue to send at any time. When the Messaging Engine calls the TransmitMessage method and passes the send adapter a new message, you can choose either to block the thread or check to see if the number of messages in the queue is larger than the maximum value you determined previously. If the maximum number of messages has been exceeded, you can use the Resubmit method to resubmit the message back to the Messaging Engine. Note that if the adapter is synchronous, the message would already be blocked.

If you do not control the source code for the adapter, you can change the number of queued messages by changing the Highwatermark value in the Adm_serviceclass table in the Configuration database. The maximum value for the Highwatermark property is 200. You can also change the value for the Lowwatermark to a smaller value.

Remember that the value of the Highwatermark property for asynchronous adapters accounts for the number of messages that the Messaging Engine has given to the adapter through the TransmitMessage method, for which the adapter has not made a corresponding call to the DeleteMessage, Resubmit, MoveToNextTransport, or MoveToSuspendQ methods. For synchronous adapters, the Highwatermark property only accounts for the number of messages the Messaging Engine has passed to the adapter by using the TransmitMessage method.

Receive Adapter Throttling

On the receive side, an adapter can submit as many batches as required to the transport proxy. When the system is heavily stressed, a call to the Done method of the IBTTransportBatch interface will block the message until the required resources are released to the system.

See Also

Developing Adapters Using the Adapter Framework

To download updated BizTalk Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=20616.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
Show: