public class DefaultJmsMessageListenerContainer
extends org.springframework.jms.listener.DefaultMessageListenerContainer
container
which listen for messages
on the JMS destination.
This implementation extends Springs DefaultMessageListenerContainer
supporting
automatic recovery and throttling.CACHE_AUTO, CACHE_CONNECTION, CACHE_CONSUMER, CACHE_NONE, CACHE_SESSION, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIX
DEFAULT_RECEIVE_TIMEOUT
Constructor and Description |
---|
DefaultJmsMessageListenerContainer(JmsEndpoint endpoint) |
DefaultJmsMessageListenerContainer(JmsEndpoint endpoint,
boolean allowQuickStop) |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.core.task.TaskExecutor |
createDefaultTaskExecutor()
Create a default TaskExecutor.
|
void |
destroy() |
protected boolean |
isAllowQuickStop()
Whether this
DefaultMessageListenerContainer allows the runningAllowed() to quick stop
in case JmsConfiguration.isAcceptMessagesWhileStopping() is enabled, and CamelContext
is currently being stopped. |
protected void |
refreshConnectionUntilSuccessful()
Refresh the underlying Connection, not returning before an attempt has been
successful.
|
protected boolean |
runningAllowed() |
protected void |
sleepInbetweenRecoveryAttempts()
Sleep according to the specified recovery interval.
|
void |
stop() |
protected void |
stopSharedConnection() |
doInitialize, doRescheduleTask, doShutdown, establishSharedConnection, getActiveConsumerCount, getCacheLevel, getConcurrentConsumers, getIdleConsumerLimit, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxMessagesPerTask, getScheduledConsumerCount, handleListenerSetupFailure, initialize, isRecovering, isRegisteredWithDestination, messageReceived, noMessageReceived, recoverAfterListenerSetupFailure, refreshDestination, scheduleNewInvokerIfAppropriate, setCacheLevel, setCacheLevelName, setConcurrency, setConcurrentConsumers, setIdleConsumerLimit, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxMessagesPerTask, setRecoveryInterval, setTaskExecutor, sharedConnectionEnabled, start, startSharedConnection, stop
createConsumer, createListenerConsumer, doReceiveAndExecute, getConnection, getSession, getTransactionManager, isPubSubNoLocal, isSessionLocallyTransacted, receiveAndExecute, receiveMessage, setPubSubNoLocal, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout, shouldCommitAfterNoMessageReceived
checkMessageListener, commitIfNecessary, doExecuteListener, doInvokeListener, doInvokeListener, executeListener, getDefaultSubscriptionName, getDestination, getDestinationDescription, getDestinationName, getDurableSubscriptionName, getExceptionListener, getMessageListener, getMessageSelector, handleListenerException, invokeErrorHandler, invokeExceptionListener, invokeListener, isAcceptMessagesWhileStopping, isExposeListenerSession, isSubscriptionDurable, rollbackIfNecessary, rollbackOnExceptionIfNecessary, setAcceptMessagesWhileStopping, setDestination, setDestinationName, setDurableSubscriptionName, setErrorHandler, setExceptionListener, setExposeListenerSession, setMessageListener, setMessageSelector, setSubscriptionDurable, validateConfiguration
afterPropertiesSet, createSharedConnection, doStart, doStop, getBeanName, getClientId, getPausedTaskCount, getPhase, getSharedConnection, isActive, isAutoStartup, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, setAutoStartup, setBeanName, setClientId, setPhase, shutdown
getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain
convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName
public DefaultJmsMessageListenerContainer(JmsEndpoint endpoint)
public DefaultJmsMessageListenerContainer(JmsEndpoint endpoint, boolean allowQuickStop)
protected boolean isAllowQuickStop()
DefaultMessageListenerContainer
allows the runningAllowed()
to quick stop
in case JmsConfiguration.isAcceptMessagesWhileStopping()
is enabled, and CamelContext
is currently being stopped.protected boolean runningAllowed()
runningAllowed
in class org.springframework.jms.listener.AbstractJmsListeningContainer
protected org.springframework.core.task.TaskExecutor createDefaultTaskExecutor()
TaskExecutor
will depend on the value of
JmsConfiguration.getDefaultTaskExecutorType()
. For more details, refer to the Javadoc of
DefaultTaskExecutorType
.
In all cases, it uses the specified bean name and Camel's ExecutorServiceManager
to resolve the thread name.createDefaultTaskExecutor
in class org.springframework.jms.listener.DefaultMessageListenerContainer
JmsConfiguration.setDefaultTaskExecutorType(DefaultTaskExecutorType)
,
ExecutorConfigurationSupport.setBeanName(String)
public void stop() throws org.springframework.jms.JmsException
stop
in interface org.springframework.context.Lifecycle
stop
in class org.springframework.jms.listener.AbstractJmsListeningContainer
org.springframework.jms.JmsException
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
destroy
in class org.springframework.jms.listener.AbstractJmsListeningContainer
protected void stopSharedConnection()
stopSharedConnection
in class org.springframework.jms.listener.DefaultMessageListenerContainer
protected void refreshConnectionUntilSuccessful()
The default implementation retries until it successfully established a Connection, for as long as this message listener container is running. Applies the specified recovery interval between retries.
refreshConnectionUntilSuccessful
in class org.springframework.jms.listener.DefaultMessageListenerContainer
DefaultMessageListenerContainer.setRecoveryInterval(long)
,
DefaultMessageListenerContainer.start()
,
stop()
protected void sleepInbetweenRecoveryAttempts()
sleepInbetweenRecoveryAttempts
in class org.springframework.jms.listener.DefaultMessageListenerContainer
Apache Camel