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_PREFIX
DEFAULT_RECEIVE_TIMEOUT
lifecycleMonitor, sharedConnectionMonitor
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 . |
applyBackOffTime, createDefaultTaskExecutor, doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleConsumerLimit, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, handleListenerSetupFailure, initialize, isRecovering, isRegisteredWithDestination, messageReceived, noMessageReceived, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, refreshDestination, scheduleNewInvokerIfAppropriate, setBackOff, setCacheLevel, setCacheLevelName, setConcurrency, setConcurrentConsumers, setIdleConsumerLimit, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, start, startSharedConnection, stop, stopSharedConnection
createListenerConsumer, doReceiveAndExecute, getConnection, getReceiveTimeout, getSession, getTransactionManager, isSessionLocallyTransacted, receiveMessage, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout, shouldCommitAfterNoMessageReceived
checkMessageListener, commitIfNecessary, createConsumer, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getErrorHandler, getExceptionListener, getMessageConverter, getMessageListener, getMessageSelector, getSubscriptionName, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isPubSubNoLocal, isReplyPubSubDomain, isSubscriptionDurable, isSubscriptionShared, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageConverter, setMessageListener, setMessageSelector, setPubSubNoLocal, setReplyPubSubDomain, setSubscriptionDurable, setSubscriptionName, setSubscriptionShared, setupMessageListener, validateConfiguration
createSharedConnection, destroy, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, setPhase, shutdown, stop
getDestinationResolver, isPubSubDomain, receiveFromConsumer, resolveDestinationName, setDestinationResolver, setPubSubDomain
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public 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.InitializingBean
afterPropertiesSet
in class org.springframework.jms.listener.AbstractJmsListeningContainer
AbstractJmsListeningContainer.afterPropertiesSet()
protected void handleListenerException(java.lang.Throwable ex)
handleListenerException
in class org.springframework.jms.listener.AbstractMessageListenerContainer
AbstractMessageListenerContainer.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.AbstractPollingMessageListenerContainer
javax.jms.JMSException
AbstractPollingMessageListenerContainer.receiveAndExecute(Object,
javax.jms.Session, javax.jms.MessageConsumer)
public void initializeProxy()