You find that messages stuck in the Adapter Engine with hanging status, such as "To be delivered". In Engine Status -> Additional Data tab, you see that it's using all the assigned threads for a specific adapter and a specific queue (for example, SOAP_http://sap.com/xi/XI/SystemCall). You may be wondering how to increase the value of Maximum Number of Threads.
Here I will introduce how to tune the queue comsumer threads for different adapters in PI/PO system.
1) For some normal adapters (SOAP, RFC, JDBC, JMS, File, HTTP_AAE, IDoc_AAE......), you can add a new property set for the specific Adapter in the property "messaging.connectionDefinition". This is appended after the global AFW entry.
You can set the custom value for property "messaging.connectionDefinition" in
-> NWA
-> Configuration
-> Infrastructure
-> Java System properties
-> Services
-> XPI Service: AF Core
or
-> ConfigTool (- \usr\sap\<SID>\<Instance ID>\j2ee\configtool)
-> template - Usage_Type_All_in_One
-> services
-> com.sap.aii.af.svc
****Please restart the system after saving these changes in NWA or in ConfigTool. Then the change will take effect and the Maximum Number of Threads for these adapters in Engine Status will be updated as expected.*****
- For example, increasing the value of Call.maxConsumers for SOAP adapter from default value 5 to 10
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60,
Send.maxConsumers=5, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5) (name=SOAP_http://sap.com/xi/XI/System, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=5, Recv.maxConsumers=5, Call.maxConsumers=10, Rqst.maxConsumers=5)
- For example, increasing the value of maxConsumers for all the queues of File adapter from 5 to 8
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=5, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5) (name=File_http://sap.com/xi/XI/System, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=8, Recv.maxConsumers=8, Call.maxConsumers=8, Rqst.maxConsumers=8)
****Please pay attention to the name part, it would be better to check the correct adapter name in Engine status. It should be case-insensitive. If you use the name=FILE_http://sap.com/xi/XI/System, the custome value can be saw in NWA or in ConfigTool, however it does not really take effect and the Maximum Number of Threads for File adapter in Engine Status will not be updated as expected.*****
- For example, increasing the value of Send.maxConsumers for SFTP adapter from 5 to 10
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=5, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5) (name=SFTP_http://sap.com/xi/XI/SFTP, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval= 60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5)
****Please pay attention to the name part, it would be better to check the correct adapter name in Engine status. It should be "name=SFTP_http://sap.com/xi/XI/SFTP", not "name=SFTP_http://sap.com/xi/XI/System".****
- For example, increasing the value of maxConsumers for File adapter and SFTP adapter together
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=5, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5) (name=File_http://sap.com/xi/XI/System, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=8, Recv.maxConsumers=8, Call.maxConsumers=8, Rqst.maxConsumers=8) (name=SFTP_http://sap.com/xi/XI/SFTP, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval= 60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=5, Call.maxConsumers=5, Rqst.maxConsumers=5)
==========
2) For the Industry Standard Adapters (e.g., CIDX, RNIF), you need to add a new property set for the specific Adapter in the property "messaging.connectionParams". You can set the custom value for this property in
-> NWA
-> Configuration
-> Infrastructure
-> Java System properties
-> Services
-> XPI Service: Messaging System
or
-> ConfigTool (- \usr\sap\<SID>\<Instance ID>\j2ee\configtool)
-> template - Usage_Type_All_in_One
-> services
-> com.sap.aii.af.ms.svc
****Please restart the system after saving these changes in NWA or in ConfigTool. Then the change will take effect and the Maximum Number of Threads for these adapters in Engine Status will be updated as expected.*****
- For example, increasing the value of Call.maxConsumers for RNIF adapter from default value 10 to 15
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=10, Call.maxConsumers=10, Rqst.maxConsumers=10) (name=RNIFAdapter, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=10, Call.maxConsumers=15, Rqst.maxConsumers=10)
- For example, increasing the value of Call.maxConsumers for RNIF11 adapter from 10 to 15
(name=global, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=10, Call.maxConsumers=10, Rqst.maxConsumers=10) (name=RNIF11Adapter, messageListener=localejbs/AFWListener, exceptionListener=localejbs/AFWListener, pollInterval=60000, pollAttempts=60, Send.maxConsumers=10, Recv.maxConsumers=10, Call.maxConsumers=15, Rqst.maxConsumers=10)
==========
3) For Integrated Configuration Object (ICO) scenarios, the message processing occurs exclusively in the MS Senderqueues (Send.maxConsumers for asynchronous outbound and Call.maxConsumers for synchronous outbound). To ensure sufficient work threads, you can consider to increase the number of Send.maxConsumers and Call.maxConsumers for specific adapter. The value of Recv.maxConsumers and Rqst.maxConsumers will not be considered in ICO scenarios.
*******
Related Notes/Documents:
SAP Note 1623356 - "To be delivered" messages in Adapter Engine
SAP Note 1557036 - Integrated Configuration Objects (ICO) scenarios use Messaging System Sender Queues only
Messaging System queue properties after XI 3.0 SP19 / XI 7.0SP11