Configure the message listener service
To support message-driven beans deployed against listener ports, configure the properties of the message listener service for the application server.
To use message-driven beans with a messaging provider that does not have a JCA Version 1.5 or 1.6 resource adapter, we cannot use activation specifications and therefore configure the beans against a listener port. There are also a few scenarios in which, although you could use activation specifications, you might still choose to use listener ports. For example, for compatibility with existing message-driven bean applications.
If we have existing message-driven beans that use the WebSphere MQ messaging provider (or a compliant third-party JMS provider) with listener ports, and instead to use EJB 3 message-driven beans with listener ports, these new beans can continue to use the same messaging provider.
For more information about when to use listener ports rather than activation specifications, see Message-driven beans, activation specifications, and listener ports.
(zos) Before configuring message listener resources, consider the message listener service implementation on the z/OS platform, which affects how you should configure the listener port. For more information, see (zos) Message listener service on z/OS.
The message listener service is an extension to the JMS functions of the JMS provider and provides a listener manager, which controls and monitors one or more JMS listeners. Each listener monitors either a JMS queue destination (for point-to-point messaging) or a JMS topic destination (for publish/subscribe messaging). For more information, see Message-driven beans - listener port components.
When you deploy an enterprise application to use message-driven beans with listener ports, we can browse or change the configuration of the message listener service for a given application server.
If the messaging system is running in non-ASF mode, to avoid unwanted transaction timeouts, you must allow a sufficient amount of time for processing to be completed before the total transaction lifetime timeout is reached. Therefore, verify the value specified for the NON.ASF.RECEIVE.TIMEOUT message listener service custom property is smaller than the value specified for the Total transaction lifetime timeout transaction service property, and also that the difference between the values of the two properties is greater than the amount of time that the onMessage() method of the message-driven bean (MDB) takes to process the message.
- Display the listener service settings page:
- In the navigation pane, select Servers > Server Types > WebSphere application servers.
- In the content pane, click the name of the application server.
- Under Communications, click Messaging > Message Listener Service.
- Optional: Browse or change the value of properties for the message-driven bean thread pool.
- Click Thread Pool.
- Change the following properties, as required:
- Minimum size
- The minimum number of threads to allow in the pool.
- Maximum size
- The maximum number of threads to allow in the pool.
- Thread inactivity timeout
- The number of milliseconds of inactivity that should elapse before a thread is reclaimed. A value of 0 indicates not to wait and a negative value (less than 0) means to wait forever.
The console does not allow you to set the inactivity timeout to a negative number. To do this modify the value directly in the config.xml file.
- Allow thread allocation beyond maximum thread size
- Select this check box to enable the number of threads to increase beyond the maximum size configured for the thread pool.
- Click OK.
- Optional: Specify any message listener service custom properties that we need, as Custom properties of the message listener service.
For more information about these custom properties, see Message listener service custom properties.
- Click Custom properties
- For each custom property, specify the name and value you require.
If we have not specified a property before:
- Click New.
- Type the name of the property.
- Type the value of the property.
- Click OK.
- Save the changes to the master configuration.
- To activate the changed configuration, stop then restart the application server.
Results
You have configured the properties of the message listener service for a given application server.
Subtopics
- Avoiding transaction timeouts in non-ASF mode
If wer 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.
Related concepts
Message-driven beans - listener port components Message processing in ASF mode and non-ASF mode
Related tasks
Administer listener ports
Message listener service custom properties Message listener service custom properties Message listener service (zos) Message listener service on z/OS