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:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- SmartInitializingSingleton,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ExpressionCapable,- OrderlyShutdownCapable,- MessageProducer,- IntegrationPattern,- NamedComponent,- IntegrationInboundManagement,- IntegrationManagement,- ManageableLifecycle,- ManageableSmartLifecycle,- TrackableComponent
public class JmsMessageDrivenEndpoint
extends MessageProducerSupport
implements OrderlyShutdownCapable
A message-driven endpoint that receive JMS messages, converts them into
 Spring Integration Messages, and then sends the result to a channel.
- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.endpoint.AbstractEndpointlifecycleCondition, lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionJmsMessageDrivenEndpoint(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) Construct an instance with an externally configured container.
- 
Method SummaryModifier and TypeMethodDescriptionintCalled after normal shutdown of schedulers, executors etc, and after the shutdown delay has elapsed, but before any forced shutdown of any remaining active scheduler/executor threads.Can optionally return the number of active messages still in process.voidintCalled before shutdown begins.voiddestroy()protected voiddoStart()Take no action by default.protected voiddoStop()Take no action by default.Subclasses may implement this method to provide component type information.protected voidonInit()Subclasses may implement this for initialization logic.voidregisterMetricsCaptor(MetricsCaptor captor) Inject aMetricsCaptor.voidregisterObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Inject anObservationRegistry.voidsetApplicationContext(ApplicationContext applicationContext) voidsetErrorChannel(MessageChannel errorChannel) voidsetErrorChannelName(String errorChannelName) Set the error channel name.voidsetObservationConvention(MessageReceiverObservationConvention observationConvention) Set a customMessageReceiverObservationConventionforIntegrationObservation.HANDLER.voidsetOutputChannel(MessageChannel outputChannel) Specify theMessageChannelto which produced Messages should be sent.voidsetOutputChannelName(String outputChannelName) Set the output channel name; overridesoutputChannelif provided.voidsetSendTimeout(long sendTimeout) Configure the default timeout value to use for send operations.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.MessageProducerSupportbuildErrorMessage, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, isObserved, sendErrorMessageIfNecessary, sendMessage, setErrorMessageStrategy, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpointdoStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
JmsMessageDrivenEndpointpublic JmsMessageDrivenEndpoint(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) Construct an instance with an externally configured container.- Parameters:
- listenerContainer- the container.
- listener- the listener.
 
 
- 
- 
Method Details- 
setSessionAcknowledgeModeSet 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.
 
- 
setOutputChannelDescription copied from interface:MessageProducerSpecify theMessageChannelto which produced Messages should be sent.- Specified by:
- setOutputChannelin interface- MessageProducer
- Overrides:
- setOutputChannelin class- MessageProducerSupport
- Parameters:
- outputChannel- The output channel.
 
- 
setOutputChannelNameDescription copied from class:MessageProducerSupportSet the output channel name; overridesoutputChannelif provided.- Specified by:
- setOutputChannelNamein interface- MessageProducer
- Overrides:
- setOutputChannelNamein class- MessageProducerSupport
- Parameters:
- outputChannelName- the channel name.
 
- 
setErrorChannel- Overrides:
- setErrorChannelin class- MessageProducerSupport
 
- 
setErrorChannelNameDescription copied from class:MessageProducerSupportSet the error channel name. If no error channel is provided, this endpoint will propagate Exceptions to the message-driven source. To completely suppress Exceptions, provide a reference to the "nullChannel" here.- Overrides:
- setErrorChannelNamein class- MessageProducerSupport
- Parameters:
- errorChannelName- The error channel bean name.
 
- 
setSendTimeoutpublic void setSendTimeout(long sendTimeout) Description copied from class:MessageProducerSupportConfigure the default timeout value to use for send operations. May be overridden for individual messages.- Overrides:
- setSendTimeoutin class- MessageProducerSupport
- Parameters:
- sendTimeout- the 'send' operation timeout in milliseconds
- See Also:
 
- 
setShouldTrackpublic void setShouldTrack(boolean shouldTrack) - Specified by:
- setShouldTrackin interface- TrackableComponent
- Overrides:
- setShouldTrackin class- MessageProducerSupport
 
- 
setShutdownContainerOnStoppublic 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
- 
registerMetricsCaptorDescription copied from interface:IntegrationManagementInject aMetricsCaptor. Ignored ifObservationRegistryis provided.- Specified by:
- registerMetricsCaptorin interface- IntegrationManagement
- Parameters:
- captor- the captor.
- See Also:
 
- 
registerObservationRegistrypublic void registerObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Description copied from interface:IntegrationManagementInject anObservationRegistry. If provided, theMetricsCaptoris ignored. The meters capturing has to be configured as anObservationHandleron the providedObservationRegistry.- Specified by:
- registerObservationRegistryin interface- IntegrationManagement
- Overrides:
- registerObservationRegistryin class- MessageProducerSupport
- Parameters:
- observationRegistry- the- ObservationRegistryto expose observations from the component.
- See Also:
 
- 
setObservationConventionDescription copied from class:MessageProducerSupportSet a customMessageReceiverObservationConventionforIntegrationObservation.HANDLER. Ignored if anObservationRegistryis not configured for this component.- Overrides:
- setObservationConventionin class- MessageProducerSupport
- Parameters:
- observationConvention- the- MessageReceiverObservationConventionto use.
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Overrides:
- setApplicationContextin class- IntegrationObjectSupport
- Throws:
- BeansException
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- IntegrationObjectSupport
 
- 
afterSingletonsInstantiatedpublic void afterSingletonsInstantiated()- Specified by:
- afterSingletonsInstantiatedin interface- SmartInitializingSingleton
- Overrides:
- afterSingletonsInstantiatedin class- MessageProducerSupport
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- MessageProducerSupport
 
- 
doStartprotected void doStart()Description copied from class:MessageProducerSupportTake no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.- Overrides:
- doStartin class- MessageProducerSupport
 
- 
doStopprotected void doStop()Description copied from class:MessageProducerSupportTake no action by default. Subclasses may override this if they need lifecycle-managed behavior.- Overrides:
- doStopin class- MessageProducerSupport
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- DisposableBean
- Specified by:
- destroyin interface- IntegrationManagement
- Overrides:
- destroyin class- AbstractEndpoint
 
- 
beforeShutdownpublic int beforeShutdown()Description copied from interface:OrderlyShutdownCapableCalled before shutdown begins. Implementations should stop accepting new messages. Can optionally return the number of active messages in process.- Specified by:
- beforeShutdownin interface- OrderlyShutdownCapable
- Returns:
- The number of active messages if available.
 
- 
afterShutdownpublic int afterShutdown()Description copied from interface:OrderlyShutdownCapableCalled after normal shutdown of schedulers, executors etc, and after the shutdown delay has elapsed, but before any forced shutdown of any remaining active scheduler/executor threads.Can optionally return the number of active messages still in process.- Specified by:
- afterShutdownin interface- OrderlyShutdownCapable
- Returns:
- The number of active messages if available.
 
 
-