| org.springframework.jms.listener.AbstractJmsListeningContainer org.springframework.jms.listener.AbstractMessageListenerContainer org.springframework.jms.listener.SimpleMessageListenerContainer
All known Subclasses: org.springframework.jms.listener.SimpleMessageListenerContainer102,
Method Summary | |
protected MessageConsumer | createConsumer(Session session, Destination destination) Create a JMS MessageConsumer for the given Session and Destination. | protected MessageConsumer | createListenerConsumer(Session session) Create a MessageConsumer for the given JMS Session,
registering a MessageListener for the specified listener. | protected void | doInitialize() Creates the specified number of concurrent consumers,
in the form of a JMS Session plus associated MessageConsumer. | protected void | doShutdown() Destroy the registered JMS Sessions and associated MessageConsumers. | protected boolean | isPubSubNoLocal() Return whether to inhibit the delivery of messages published by its own connection. | public void | setConcurrentConsumers(int concurrentConsumers) Specify the number of concurrent consumers to create. | public void | setPubSubNoLocal(boolean pubSubNoLocal) Set whether to inhibit the delivery of messages published by its own connection. | public void | setTaskExecutor(TaskExecutor taskExecutor) Set the Spring TaskExecutor to use for executing the listener once
a message has been received by the provider.
Default is none, that is, to run in the JMS provider's own receive thread,
blocking the provider's receive endpoint while executing the listener.
Specify a TaskExecutor for executing the listener in a different thread,
rather than blocking the JMS provider, usually integrating with an existing
thread pool. | final protected boolean | sharedConnectionEnabled() Always use a shared JMS Connection. | protected void | validateConfiguration() |
createConsumer | protected MessageConsumer createConsumer(Session session, Destination destination) throws JMSException(Code) | | Create a JMS MessageConsumer for the given Session and Destination.
This implementation uses JMS 1.1 API.
Parameters: session - the JMS Session to create a MessageConsumer for Parameters: destination - the JMS Destination to create a MessageConsumer for the new JMS MessageConsumer throws: JMSException - if thrown by JMS API methods |
createListenerConsumer | protected MessageConsumer createListenerConsumer(Session session) throws JMSException(Code) | | Create a MessageConsumer for the given JMS Session,
registering a MessageListener for the specified listener.
Parameters: session - the JMS Session to work on the MessageConsumer throws: JMSException - if thrown by JMS methods See Also: SimpleMessageListenerContainer.executeListener |
doShutdown | protected void doShutdown() throws JMSException(Code) | | Destroy the registered JMS Sessions and associated MessageConsumers.
|
isPubSubNoLocal | protected boolean isPubSubNoLocal()(Code) | | Return whether to inhibit the delivery of messages published by its own connection.
|
setConcurrentConsumers | public void setConcurrentConsumers(int concurrentConsumers)(Code) | | Specify the number of concurrent consumers to create. Default is 1.
Raising the number of concurrent consumers is recommendable in order
to scale the consumption of messages coming in from a queue. However,
note that any ordering guarantees are lost once multiple consumers are
registered. In general, stick with 1 consumer for low-volume queues.
Do not raise the number of concurrent consumers for a topic.
This would lead to concurrent consumption of the same message,
which is hardly ever desirable.
|
setPubSubNoLocal | public void setPubSubNoLocal(boolean pubSubNoLocal)(Code) | | Set whether to inhibit the delivery of messages published by its own connection.
Default is "false".
See Also: javax.jms.TopicSession.createSubscriber(javax.jms.TopicStringboolean) |
setTaskExecutor | public void setTaskExecutor(TaskExecutor taskExecutor)(Code) | | Set the Spring TaskExecutor to use for executing the listener once
a message has been received by the provider.
Default is none, that is, to run in the JMS provider's own receive thread,
blocking the provider's receive endpoint while executing the listener.
Specify a TaskExecutor for executing the listener in a different thread,
rather than blocking the JMS provider, usually integrating with an existing
thread pool. This allows to keep the number of concurrent consumers low (1)
while still processing messages concurrently (decoupled from receiving!).
NOTE: Specifying a TaskExecutor for listener execution affects
acknowledgement semantics. Messages will then always get acknowledged
before listener execution, with the underlying Session immediately reused
for receiving the next message. Using this in combination with a transacted
session or with client acknowledgement will lead to unspecified results!
NOTE: Concurrent listener execution via a TaskExecutor will lead
to concurrent processing of messages that have been received by the same
underlying Session. As a consequence, it is not recommended to use
this setting with a
SessionAwareMessageListener , at least not
if the latter performs actual work on the given Session. A standard
javax.jms.MessageListener will work fine, in general.
See Also: SimpleMessageListenerContainer.setConcurrentConsumers See Also: org.springframework.core.task.SimpleAsyncTaskExecutor See Also: org.springframework.scheduling.commonj.WorkManagerTaskExecutor |
sharedConnectionEnabled | final protected boolean sharedConnectionEnabled()(Code) | | Always use a shared JMS Connection.
|
validateConfiguration | protected void validateConfiguration()(Code) | | |
|
|