Defining multiple threads for serial and parallel listeners

By default, WebSphere 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. Define JMS queue destinations in WebSphere Application Server Administrative Console. See Creating IBM MQ messaging provider queue destinations for more information.
    2. Create a backup copy of the instance_name.xml file in case your changes cause errors.
    3. 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> 
      
    4. 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.
    5. Propagate the changes made to your WebSphere Commerce configuration file. For instructions on propagating these changes, see Propagating changes to the WebSphere Commerce configuration file.
    6. Restart WebSphere Commerce Server for the changes to take effect.
  • Increase the number of threads that are running parallel to the listener:
    1. Open the Configuration Manager.
    2. Navigate to WebSphere Commerce > node_name > Commerce > Instance List > instance_name > Transports > InboundListener for IBM MQ (JMS_Inbound)-Parallel.
    3. Increase the number of threads in the Threads property.
    4. Click Apply.
  • After your changes are applied, update the work manager thread pool size and the total number of database connections to accommodate the increased maximum number of listener threads. See WebSphere Application Server considerations for more information.
    1. Increase the maximum number of work manager threads.
      1. Open the WebSphere Application Server Administrative Console.
      2. Navigate to Work manager > reserved.
      3. Under Thread pool properties, enter the new value for the Maximum number of threads property.
      4. Save your changes.
    2. Increase the database connection pool size.
      1. Open the WebSphere Application Server Administrative Console.
      2. Browse to Resources > JDBC > Data sources > WebSphere Commerce > db_type > DataSource > instance_name > Connection pool properties.

        Where db_type is either DB2 or Oracle.

      3. Increase the database connection pool size by the same number of work manager threads that you added.
      4. Save your changes.