Managing SAP Connections with LOB SAP Adapter in BizTalk 2006 R2

Recently I was working with a client to connect a BizTalk 2006 R2 process to SAP with the LOB SAP adapter. We first called a BAPI function that returned a list of contract IDs that had been modified since our last successful processing event (usually 24 hours). This list could contain anywhere from 1000 to 10000 contract IDs depending on volume and amount of time since the last processing event. Once we had the collection of contract IDs we iterate over the collection calling a separate BAPI function to retrieve the contract data for each contract ID. We quickly ran into the issue where BizTalk was overwhelming the SAP server with BAPI calls. In order to fix the issue we throttled down the number of connections made by the BizTalk Server.

To do this, we use the WCF-Custom Adapter with SAP bindings. In our Solicit-Response Send Port we select WCF-Custom as our Type and click "Configure". Click on the "Binding" tab and select sapBinding from the Binding Type drop-down. The configuration window will now display. This will look familiar to users of the mySAP adapter. The maxConnectionPerSystem setting is the one we are concerned with. In the specific instance above, we found a "sweet spot" of 25 connections. You will have to work with your SAP administrators to determine what this number will be. Make sure to consider other systems that connect to SAP (it is the SAP connection pool that we are trying to avoid overwhelming). Some trial and error are involved. Make sure to perform some high volume load testing to ensure that SAP is not being overwhelmed.

No comments: