Class JmsInboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.jms.JmsInboundGateway
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ComponentSourceAware,- ExpressionCapable,- OrderlyShutdownCapable,- IntegrationPattern,- NamedComponent,- IntegrationInboundManagement,- IntegrationManagement,- ManageableLifecycle,- ManageableSmartLifecycle,- TrackableComponent
A wrapper around the 
JmsMessageDrivenEndpoint implementing
 MessagingGatewaySupport.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupportMessagingGatewaySupport.ConvertingMessagingTemplateNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.gateway.MessagingGatewaySupportmessagingTemplateFields 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 SummaryConstructorsConstructorDescriptionJmsInboundGateway(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) 
- 
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.intCalled before shutdown begins.voiddestroy()protected voiddoStart()Subclasses must implement this method with the start behavior.protected voiddoStop()Subclasses must implement this method with the stop behavior.Subclasses may implement this method to provide component type information.protected voidonInit()Subclasses may implement this for initialization logic.voidregisterMetricsCaptor(MetricsCaptor metricsCaptorToRegister) Inject aMetricsCaptor.voidregisterObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Inject anObservationRegistry.voidsetApplicationContext(ApplicationContext applicationContext) voidsetErrorChannel(MessageChannel errorChannel) Set the error channel.voidsetErrorChannelName(String errorChannelName) Set the error channel name.voidsetErrorOnTimeout(boolean errorOnTimeout) If errorOnTimeout is true, construct an instance that will send anErrorMessagewith aMessageTimeoutExceptionpayload to the error channel if a reply is expected but none is received.voidsetObservationConvention(MessageRequestReplyReceiverObservationConvention observationConvention) voidsetReplyChannel(MessageChannel replyChannel) Set the reply channel.voidsetReplyChannelName(String replyChannelName) Set the reply channel name.voidsetReplyTimeout(long replyTimeout) Set the timeout value for receiving reply messages.voidsetRequestChannel(MessageChannel requestChannel) Set the request channel.voidsetRequestChannelName(String requestChannelName) Set the request channel name.voidsetRequestTimeout(long requestTimeout) Set the timeout value for sending request messages.voidsetShouldTrack(boolean shouldTrack) Specify whether this gateway should be tracked in the Message History of Messages that originate from its send or sendAndReceive operations.voidsetShutdownContainerOnStop(boolean shutdownContainerOnStop) Set tofalseto prevent listener container shutdown when the endpoint is stopped.Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupportbuildErrorMessage, buildSendTimer, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorMessageStrategy, setLoggingEnabled, setManagedName, setManagedType, setReceiverObservationConvention, setReplyMapper, setRequestMapperMethods 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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, 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.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
JmsInboundGatewaypublic JmsInboundGateway(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) 
 
- 
- 
Method Details- 
setRequestChannelDescription copied from class:MessagingGatewaySupportSet the request channel.- Overrides:
- setRequestChannelin class- MessagingGatewaySupport
- Parameters:
- requestChannel- the channel to which request messages will be sent
 
- 
setRequestChannelNameDescription copied from class:MessagingGatewaySupportSet the request channel name.- Overrides:
- setRequestChannelNamein class- MessagingGatewaySupport
- Parameters:
- requestChannelName- the channel bean name to which request messages will be sent
 
- 
setReplyChannelDescription copied from class:MessagingGatewaySupportSet the reply channel. If no reply channel is provided, this gateway will always use an anonymous, temporary channel for handling replies.- Overrides:
- setReplyChannelin class- MessagingGatewaySupport
- Parameters:
- replyChannel- the channel from which reply messages will be received
 
- 
setReplyChannelNameDescription copied from class:MessagingGatewaySupportSet the reply channel name. If no reply channel is provided, this gateway will always use an anonymous, temporary channel for handling replies.- Overrides:
- setReplyChannelNamein class- MessagingGatewaySupport
- Parameters:
- replyChannelName- the channel bean name from which reply messages will be received
 
- 
setErrorChannelDescription copied from class:MessagingGatewaySupportSet the error channel. If no error channel is provided, this gateway will propagate Exceptions to the caller. To completely suppress Exceptions, provide a reference to the "nullChannel" here.- Overrides:
- setErrorChannelin class- MessagingGatewaySupport
- Parameters:
- errorChannel- The error channel.
 
- 
setErrorChannelNameDescription copied from class:MessagingGatewaySupportSet the error channel name. If no error channel is provided, this gateway will propagate Exceptions to the caller. To completely suppress Exceptions, provide a reference to the "nullChannel" here.- Overrides:
- setErrorChannelNamein class- MessagingGatewaySupport
- Parameters:
- errorChannelName- The error channel bean name.
 
- 
setRequestTimeoutpublic void setRequestTimeout(long requestTimeout) Description copied from class:MessagingGatewaySupportSet the timeout value for sending request messages. If not explicitly configured, the default is one second.- Overrides:
- setRequestTimeoutin class- MessagingGatewaySupport
- Parameters:
- requestTimeout- the timeout value in milliseconds
 
- 
setReplyTimeoutpublic void setReplyTimeout(long replyTimeout) Description copied from class:MessagingGatewaySupportSet the timeout value for receiving reply messages. If not explicitly configured, the default is one second.- Overrides:
- setReplyTimeoutin class- MessagingGatewaySupport
- Parameters:
- replyTimeout- the timeout value in milliseconds
 
- 
setErrorOnTimeoutpublic void setErrorOnTimeout(boolean errorOnTimeout) Description copied from class:MessagingGatewaySupportIf errorOnTimeout is true, construct an instance that will send anErrorMessagewith aMessageTimeoutExceptionpayload to the error channel if a reply is expected but none is received. If no error channel is configured, theMessageTimeoutExceptionwill be thrown.- Overrides:
- setErrorOnTimeoutin class- MessagingGatewaySupport
- Parameters:
- errorOnTimeout- true to create the error message on reply timeout.
 
- 
setShouldTrackpublic void setShouldTrack(boolean shouldTrack) Description copied from class:MessagingGatewaySupportSpecify whether this gateway should be tracked in the Message History of Messages that originate from its send or sendAndReceive operations.- Specified by:
- setShouldTrackin interface- TrackableComponent
- Overrides:
- setShouldTrackin class- MessagingGatewaySupport
 
- 
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
 
- 
registerMetricsCaptorDescription copied from interface:IntegrationManagementInject aMetricsCaptor. Ignored ifObservationRegistryis provided.- Specified by:
- registerMetricsCaptorin interface- IntegrationManagement
- Overrides:
- registerMetricsCaptorin class- MessagingGatewaySupport
- Parameters:
- metricsCaptorToRegister- 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- MessagingGatewaySupport
- Parameters:
- observationRegistry- the- ObservationRegistryto expose observations from the component.
- See Also:
 
- 
setObservationConventionpublic void setObservationConvention(MessageRequestReplyReceiverObservationConvention observationConvention) - Overrides:
- setObservationConventionin class- MessagingGatewaySupport
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- MessagingGatewaySupport
 
- 
setApplicationContext- Specified by:
- setApplicationContextin interface- ApplicationContextAware
- Overrides:
- setApplicationContextin class- IntegrationObjectSupport
- Throws:
- BeansException
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- MessagingGatewaySupport
 
- 
getListener
- 
doStartprotected void doStart()Description copied from class:AbstractEndpointSubclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
- doStartin class- MessagingGatewaySupport
 
- 
doStopprotected void doStop()Description copied from class:AbstractEndpointSubclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
- doStopin class- MessagingGatewaySupport
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- DisposableBean
- Specified by:
- destroyin interface- IntegrationManagement
- Overrides:
- destroyin class- MessagingGatewaySupport
 
- 
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.
 
 
-