Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer Messaging resources > Manage message-driven beans > Manage message listener resources for message-driven beans > Configure the message listener service File name: tmb_nonasftimeout.html


Avoiding transaction timeouts in non-ASF mode

If your messaging system runs in non-Application Server Facilities (non-ASF) mode, configure the Total transaction lifetime timeout transaction service property and the NON.ASF.RECEIVE.TIMEOUT message listener service custom property correctly, to avoid unwanted transaction timeouts.

To carry out the steps in this task, your messaging system must be running in non-ASF mode.

To change from ASF mode to non-ASF mode, add the NON.ASF.RECEIVE.TIMEOUT custom property to the message listener service as described in Configure the message listener service.

For WAS v7 and later, listener ports are stabilized. For more information, read the article on stabilized features. You should plan to migrate your WebSphere MQ message-driven bean deployment configurations from using listener ports to using activation specifications. However, you should not begin this migration until you are sure the application does not have to work on application servers earlier than WAS v7. For example, if we have an application server cluster with some members at v6.1 and some at v7, you should not migrate applications on that cluster to use activation specifications until after you migrate all the application servers in the cluster to v7.

If your messaging system is running in non-ASF mode, to avoid unwanted transaction timeouts, make sure that the time that you specify for the NON.ASF.RECEIVE.TIMEOUT message listener service custom property is smaller than the sum of the maximum amount of time that the onMessage() method of the message-driven bean (MDB) takes to process the message, plus the time you specify for the Total transaction lifetime timeout transaction service property.


Procedure

  1. To configure the Total transaction lifetime timeout transaction service property, complete step 8 in Configure transaction properties for an application server.

  2. To configure the NON.ASF.RECEIVE.TIMEOUT message listener service custom property, click...

        > Server Types > WebSphere application servers > server_name

    > [Communications] Messaging > Message Listener Service > Custom Properties .

  3. Click NON.ASF.RECEIVE.TIMEOUT. The General Properties page is displayed.
  4. Modify the Value field. The value for NON.ASF.RECEIVE.TIMEOUT must be specified in milliseconds. Make sure that the value you specify, when converted into seconds (by dividing by 1000) , is less than the value we have specified for Total transaction lifetime timeout combined with the maximum number of seconds the onMessage() method of your MDB takes to process a message.

  5. Click OK.

  6. Stop and restart the application server.


Example

If Total transaction lifetime timeout and NON.ASF.RECEIVE.TIMEOUT are not correctly configured, transactions can time out before they are completed. This is because the thread begins calling the receive() method as soon as the transaction is created. In the following example, NON.ASF.RECEIVE.TIMEOUT is set to 110000 milliseconds (110 seconds), Total transaction lifetime timeout is set to 120 seconds and the onMessage () method of the MDB takes 15 seconds to process a message. The example supposes that a message does not appear at the destination until the receive() method has almost timed out:

  1. The listener port starts and allocates a thread from the thread pool and creates a transaction on the thread.
  2. The thread calls the receive() method to listen for messages.

  3. After 110 seconds a message appears at the destination.
  4. The thread removes the message from the destination and calls the onMessage() method of the MDB to begin processing the message.
  5. Ten seconds later, the transaction timeout is reached. The application server marks the transaction for rollback.
  6. Five seconds later, the onMessage() method finishes processing the message and tries to commit the transaction.
  7. The total amount of time that has elapsed since the transaction was started is 125 seconds (110 seconds waiting for a message, plus 15 seconds to process the message). As this time is longer than the transaction timeout, the application server prevents the transaction from being committed, and it is rolled back.


Message processing in ASF mode and non-ASF mode
Strict message ordering using non-ASF listener ports
Configure transaction properties for an application server
Configure the message listener service


Related


Message listener service custom properties

aug2011

+

Search Tips   |   Advanced Search