JMS listener container
A container for hosting JMS message listeners that share the same connection settings.
JMS message listeners are responsible for receiving JMS messages from a specific JMS destination and then processing them.
If you want to receive JMS messages and process them using a normal message flow, use a JMS inbound channel adapter or JMS inbound gateway instead (both are specialized implementations of JMS listener container that are optimized for this specific case).
Connection factory
The JMS connection factory for creating connections to the JMS server.
Required
Note: Don't use a caching connection factory in combination with dynamic scaling. Ideally, don't use it with a message listener container at all, since it is generally preferable to let the listener container itself handle appropriate caching within its lifecycle. Also, stopping and restarting a listener container will only work with an independent, locally cached connection - not with an externally cached one.
Destination type
The JMS destination type for this listener: queue, topic, durableTopic, sharedTopic, sharedDurableTopic. This enables potentially the pubSubDomain, subscriptionDurable and subscriptionShared properties of the container.
Default is queue (i.e. disabling those 3 properties).
The JMS message listeners hosted in this container.
Concurrency
The number of concurrent sessions/consumers to start for each listener. Can either be a simple number indicating the maximum number (e.g. 5
) or a range indicating the lower as well as the upper limit (e.g. 3-5
). Note that a specified minimum is just a hint and might be ignored at runtime.
Keep concurrency limited to 1 in case of a topic listener or if message ordering is important; consider raising it for general queues.
Default is 1
.
Acknowledge
JMS acknowledge modes:
- Auto (default): automatic message acknowledgment before listener execution; no redelivery in case of exception thrown.
- Client: automatic message acknowledgment after successful listener execution; no redelivery in case of exception thrown.
- Dups-ok: lazy message acknowledgment during or after listener execution; potential redelivery in case of exception thrown.
- Transacted: transactional acknowledgment after successful listener execution; guaranteed redelivery in case of exception thrown.
Message converter
A reference to the message converter strategy for converting JMS messages to listener method arguments.
Default is a SimpleMessageConverter
.
Task executor
A reference to a task executor for executing JMS listener invokers.
Default is a SimpleAsyncTaskExecutor
using internally managed threads.
Response destination type
The JMS destination type for responses: queue or topic.
Default is the value of the destination-type attribute.
Client ID
The JMS client ID for this listener container.
Needs to be specified when using subscriptions.
Cache
The cache level for JMS resources (none, connection, session, consumer or auto).
By default (auto) the cache level will effectively be consumer, unless an external transaction manager has been specified in which case the effective default will be none (assuming J2EE-style transaction management where the given connection factory is an XA-aware pool).
Prefetch
The maximum number of messages to load into a single session.
Note that raising this number might lead to starvation of concurrent consumers!
Recovery interval
Specify the interval between recovery attempts, in milliseconds.
Default is 5000
ms (5 seconds).
Receive timeout
The timeout (in milliseconds) to use for receive calls; -1
indicates no timeout at all.
Default is 1000
(1 second).