Class JmsMessageDrivenEndpoint
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.jms.JmsMessageDrivenEndpoint
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.context.OrderlyShutdownCapable,org.springframework.integration.core.MessageProducer,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationInboundManagement,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.ManageableLifecycle,org.springframework.integration.support.management.ManageableSmartLifecycle,org.springframework.integration.support.management.TrackableComponent
public class JmsMessageDrivenEndpoint
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.integration.context.OrderlyShutdownCapable
A message-driven endpoint that receive JMS messages, converts them into
Spring Integration Messages, and then sends the result to a channel.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionJmsMessageDrivenEndpoint(org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) Construct an instance with an externally configured container. -
Method Summary
Modifier and TypeMethodDescriptionintvoidintvoiddestroy()protected voiddoStart()protected voiddoStop()protected voidonInit()voidregisterMetricsCaptor(org.springframework.integration.support.management.metrics.MetricsCaptor captor) voidregisterObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetErrorChannel(org.springframework.messaging.MessageChannel errorChannel) voidsetErrorChannelName(String errorChannelName) voidsetObservationConvention(org.springframework.integration.support.management.observation.MessageReceiverObservationConvention observationConvention) voidsetOutputChannel(org.springframework.messaging.MessageChannel outputChannel) voidsetOutputChannelName(String outputChannelName) voidsetSendTimeout(long sendTimeout) voidsetSessionAcknowledgeMode(String sessionAcknowledgeMode) Set the session acknowledge mode on the listener container.voidsetShouldTrack(boolean shouldTrack) voidsetShutdownContainerOnStop(boolean shutdownContainerOnStop) Set tofalseto prevent listener container shutdown when the endpoint is stopped.Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, sendErrorMessageIfNecessary, sendMessage, setErrorMessageStrategy, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
JmsMessageDrivenEndpoint
public JmsMessageDrivenEndpoint(org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) Construct an instance with an externally configured container.- Parameters:
listenerContainer- the container.listener- the listener.
-
-
Method Details
-
setSessionAcknowledgeMode
Set the session acknowledge mode on the listener container. It will override the container setting even if an external container is provided. Defaults to null (won't change container) if an external container is provided or `transacted` when the framework creates an implicitDefaultMessageListenerContainer.- Parameters:
sessionAcknowledgeMode- the acknowledgement mode.
-
setOutputChannel
public void setOutputChannel(org.springframework.messaging.MessageChannel outputChannel) - Specified by:
setOutputChannelin interfaceorg.springframework.integration.core.MessageProducer- Overrides:
setOutputChannelin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setOutputChannelName
- Specified by:
setOutputChannelNamein interfaceorg.springframework.integration.core.MessageProducer- Overrides:
setOutputChannelNamein classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannel
public void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel) - Overrides:
setErrorChannelin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannelName
- Overrides:
setErrorChannelNamein classorg.springframework.integration.endpoint.MessageProducerSupport
-
setSendTimeout
public void setSendTimeout(long sendTimeout) - Overrides:
setSendTimeoutin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack) - Specified by:
setShouldTrackin interfaceorg.springframework.integration.support.management.TrackableComponent- Overrides:
setShouldTrackin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setShutdownContainerOnStop
public void setShutdownContainerOnStop(boolean shutdownContainerOnStop) Set tofalseto prevent listener container shutdown when the endpoint is stopped. Then, if so configured, any cached consumer(s) in the container will remain. Otherwise, the shared connection and will be closed and the listener invokers shut down; this behavior is new starting with version 5.1. Default: true.- Parameters:
shutdownContainerOnStop- false to not shutdown.- Since:
- 5.1
-
getListener
-
registerMetricsCaptor
public void registerMetricsCaptor(org.springframework.integration.support.management.metrics.MetricsCaptor captor) - Specified by:
registerMetricsCaptorin interfaceorg.springframework.integration.support.management.IntegrationManagement
-
registerObservationRegistry
public void registerObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) - Specified by:
registerObservationRegistryin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
registerObservationRegistryin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setObservationConvention
public void setObservationConvention(org.springframework.integration.support.management.observation.MessageReceiverObservationConvention observationConvention) - Overrides:
setObservationConventionin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Overrides:
setApplicationContextin classorg.springframework.integration.context.IntegrationObjectSupport- Throws:
org.springframework.beans.BeansException
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.context.IntegrationObjectSupport
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton- Overrides:
afterSingletonsInstantiatedin classorg.springframework.integration.endpoint.MessageProducerSupport
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStopin classorg.springframework.integration.endpoint.MessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceorg.springframework.integration.support.management.IntegrationManagement- Overrides:
destroyin classorg.springframework.integration.endpoint.AbstractEndpoint
-
beforeShutdown
public int beforeShutdown()- Specified by:
beforeShutdownin interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-
afterShutdown
public int afterShutdown()- Specified by:
afterShutdownin interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-