public class BatchMessageListenerContainer
extends org.springframework.jms.listener.DefaultMessageListenerContainer
TransactionInterceptor and the RepeatOperationsInterceptor in
the advice chain (with or without a transaction manager set in the base
class). Instead of receiving a single message and processing it, the
container will then use a RepeatOperations to receive multiple
messages in the same thread. Use with a RepeatOperations and a
transaction interceptor. If the transaction interceptor uses XA then use an
XA connection factory, or else the
TransactionAwareConnectionFactoryProxy to synchronize the JMS session
with the ongoing transaction (opening up the possibility of duplicate
messages after a failure). In the latter case you will not need to provide a
transaction manager in the base class - it only gets on the way and prevents
the JMS session from synchronizing with the database transaction.| Modifier and Type | Class and Description |
|---|---|
static interface |
BatchMessageListenerContainer.ContainerDelegate |
CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, CACHE_SESSION, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIXDEFAULT_RECEIVE_TIMEOUT| Constructor and Description |
|---|
BatchMessageListenerContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Set up interceptor with provided advice on the
receiveAndExecute(Object, Session, MessageConsumer) method. |
protected void |
handleListenerException(java.lang.Throwable ex)
Override base class to prevent exceptions from being swallowed.
|
void |
initializeProxy() |
protected boolean |
receiveAndExecute(java.lang.Object invoker,
javax.jms.Session session,
javax.jms.MessageConsumer consumer)
Override base class method to wrap call in advice if provided.
|
void |
setAdviceChain(org.aopalliance.aop.Advice[] advices)
Public setter for the
Advice. |
createDefaultTaskExecutor, doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleConsumerLimit, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, handleListenerSetupFailure, initialize, isRecovering, isRegisteredWithDestination, messageReceived, noMessageReceived, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, refreshDestination, scheduleNewInvokerIfAppropriate, setCacheLevel, setCacheLevelName, setConcurrency, setConcurrentConsumers, setIdleConsumerLimit, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, sleepInbetweenRecoveryAttempts, start, startSharedConnection, stop, stopSharedConnectioncreateConsumer, createListenerConsumer, doReceiveAndExecute, getConnection, getSession, getTransactionManager, isPubSubNoLocal, isSessionLocallyTransacted, receiveMessage, setPubSubNoLocal, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout, shouldCommitAfterNoMessageReceivedcheckMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable, validateConfigurationcreateSharedConnection, destroy, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, stopgetDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomainconvertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeNamepublic void setAdviceChain(org.aopalliance.aop.Advice[] advices)
Advice.advices - the advice to setpublic void afterPropertiesSet()
receiveAndExecute(Object, Session, MessageConsumer) method.afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class org.springframework.jms.listener.AbstractJmsListeningContainerAbstractJmsListeningContainer.afterPropertiesSet()protected void handleListenerException(java.lang.Throwable ex)
handleListenerException in class org.springframework.jms.listener.AbstractMessageListenerContainerAbstractMessageListenerContainer.handleListenerException(java.lang.Throwable)protected boolean receiveAndExecute(java.lang.Object invoker,
javax.jms.Session session,
javax.jms.MessageConsumer consumer)
throws javax.jms.JMSException
receiveAndExecute in class org.springframework.jms.listener.AbstractPollingMessageListenerContainerjavax.jms.JMSExceptionAbstractPollingMessageListenerContainer.receiveAndExecute(Object,
javax.jms.Session, javax.jms.MessageConsumer)public void initializeProxy()