Defining multiple threads for serial and parallel listeners

By default, HCL Commerce configuration provides two inbound listeners: one serial listener and one parallel listener. To use multiple inbound queues, you must define multiple inbound listeners for IBM MQ.To add another listener:

Procedure

Increase the number of threads for serial listeners:
  1. Create a backup copy of the instance_name.xml file in case your changes cause errors.
  2. Open the instance_name.xml file in a text editor and locate the snippet that defines a default inbound listener:
    
    <Inbound> 
         <InboundSerialConnector 
           TimeToReconnect="600" 
           default="true" 
           enabled="true" id="1" name="Listener for IBM MQ (JMS Inbound) - Serial"> 
           
         </InboundSerialConnector> 
    
  3. Add a definition:
    
    <InboundSerialConnector 
           TimeToReconnect="600" 
           default="true" 
           enabled="true" id="3" name="Listener for IBM MQ (JMS Inbound) - Serial - Custom"> 
           <JNDI 
             JndiName="eis/JCAJMS" display="false"/> 
           <ConnectionSpec 
             ClassName="com.ibm.commerce.messaging.adapters.jcajms.JCAJMSConnectionSpec" default="true"> 
             <EditableProperty 
               Admin="factory" 
               display="false" 
               editable="Yes" 
               name="setConnectionFactory" value="JMSQueueConnectionFactory"/> 
             <EditableProperty 
               Admin="inQueue" 
               display="false" 
               editable="Yes" 
               name="setInboundQueue" value="CustomJMSSerialInboundQueue"/> 
             <EditableProperty 
               Admin="errorQueue" 
               display="false" 
               editable="Yes" 
               name="setErrorQueue" value="JMSErrorQueue"/> 
             <EditableProperty 
               Admin="outQueue" 
               display="false" 
               editable="Yes" 
               name="setOutboundQueue" value="JMSOutboundQueue"/> 
           </ConnectionSpec> 
           <InteractionSpec 
             ClassName="com.ibm.commerce.messaging.adapters.jcajms.JCAJMSInteractionSpec" default="true"> 
             <EditableProperty 
               Admin="timeOut" 
               display="false" 
               editable="Yes" 
               name="setTimeOut" value="4"/> 
             <EditableProperty 
               Admin="mode" 
               display="false" 
               editable="Yes" 
               name="setMode" value="2"/> 
           </InteractionSpec> 
         </InboundSerialConnector>
    
    Note:
    • Ensure that you substitute the correct JMS object names for the connection factories and queue destinations.
    • Ensure that you set the ID to a unique number.
  4. By default wcsadmin is used as a messaging admin user to run the controller command to process messages.

    XMLWebControllerUserId="wcsadmin"

    Due to MemberLock limitations this user (wcsadmin) will not be able to trigger multiple instances of the controller command simultaneously with multiple serial inbound listeners.

    To overcome this limitation, you can create a new admin user and use the same in XMLWebControllerUserId insidewc-server.xml

  5. Exempt the newly created messaging admin user in step #5 from MemberLock.

    Insidewc-server.xml add the below Configuration before end of the InstanceProperties tag.

    <com.ibm.commerce.user.beans.MemberLock noLockMemberIds="newUserId" />
  6. Restart HCL Commerce transaction server for the changes to take effect.

    Increase the number of threads that are running parallel to the listener:

    Inside the parallel inbound listener configuration there is a parameter, threads , which holds an integer value of number of threads, you can increase the value as per your requirement in the same configuration.

    For example: If you wish to increase the threads to 4 change the default value to threads="4" keeping the other configuration the same in wc-server .xml

    <InboundParallelConnector TimeToReconnect="600" default="true" enabled="true" id="11" name="Listener for IBM MQ (JMS Inbound) - Parallel" threads="4"></InboundParallelConnector>

    After your changes are applied, update the work manager thread pool size to accommodate the increased maximum number of listener threads.

    Enterprise Applications > ts > Manage Modules > Enablement-JCAJMSConnector.rar > ts.Adapter for WebSphere MQ > J2C connection factories > Enablement-JCAJMSConnector.rar > Connection Pools

    Once you save the configuration restart Transaction server to reflect the changes.