Class SnsInboundChannelAdapter
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Lifecycle,Phased,SmartLifecycle,org.springframework.integration.context.ComponentSourceAware,org.springframework.integration.context.ExpressionCapable,org.springframework.integration.context.OrderlyShutdownCapable,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,HttpRequestHandler
HttpRequestHandlingMessagingGateway extension for the Amazon WS SNS HTTP(S) endpoints. Accepts all
x-amz-sns-message-types, converts the received Topic JSON message to the Map using
MappingJackson2HttpMessageConverter and send it to the provided
MessagingGatewaySupport.getRequestChannel() as Message payload.
The mapped url must be configured inside the Amazon Web Service platform as a subscription. Before receiving any notification itself, this HTTP endpoint must confirm the subscription.
The handleNotificationStatus flag (defaults to false) indicates that this endpoint should send the
SubscriptionConfirmation/UnsubscribeConfirmation messages to the provided MessagingGatewaySupport.getRequestChannel(). If
that, the SnsHeaders.NOTIFICATION_STATUS_HEADER header is populated with the NotificationStatus
value. In that case it is a responsibility of the application to NotificationStatus.confirmSubscription() or
not.
By default, this endpoint just does NotificationStatus.confirmSubscription() for the
SubscriptionConfirmation message type. And does nothing for the UnsubscribeConfirmation.
For the convenience on the underlying message flow routing a SnsHeaders.SNS_MESSAGE_TYPE_HEADER header is
present.
- Since:
- 4.0
- Author:
- Artem Bilan, Kamil Przerwa
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.gateway.MessagingGatewaySupport.ConvertingMessagingTemplateNested 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.http.inbound.BaseHttpInboundEndpoint
activeCount, JAXB_PRESENT, NON_READABLE_BODY_HTTP_METHODS, ROME_TOOLS_PRESENTFields inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
messagingTemplateFields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
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
ConstructorsConstructorDescriptionSnsInboundChannelAdapter(software.amazon.awssdk.services.sns.SnsClient amazonSns, String... path) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonInit()protected voidvoidsetExtractReplyPayload(boolean extractReplyPayload) voidsetHandleNotificationStatus(boolean handleNotificationStatus) The flag indicating if the adapter should sendSubscriptionConfirmation/UnsubscribeConfirmationmessage to the `output-channel` or not.voidsetHeaderExpressions(Map<String, Expression> headerExpressions) voidsetHeaderMapper(org.springframework.integration.mapping.HeaderMapper<HttpHeaders> headerMapper) voidsetMergeWithDefaultConverters(boolean mergeWithDefaultConverters) voidsetMessageConverters(List<HttpMessageConverter<?>> messageConverters) voidsetMultipartResolver(MultipartResolver multipartResolver) voidsetPayloadExpression(Expression payloadExpression) voidsetRequestMapping(org.springframework.integration.http.inbound.RequestMapping requestMapping) voidsetRequestPayloadTypeClass(Class<?> requestPayloadType) voidsetStatusCodeExpression(Expression statusCodeExpression) Methods inherited from class org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway
handleRequest, setConvertExceptionsMethods inherited from class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
doHandleRequest, extractRequestBody, getMessageConverters, prepareRequest, prepareRequestEntity, setStatusCodeIfNeeded, setupResponseAndConvertReplyMethods inherited from class org.springframework.integration.http.inbound.BaseHttpInboundEndpoint
afterShutdown, beforeShutdown, createEvaluationContext, evaluateHttpStatus, getCrossOrigin, getExtractReplyPayload, getHeaderExpressions, getHeaderMapper, getIntegrationPatternType, getPayloadExpression, getRequestMapping, getRequestPayloadType, getStatusCodeExpression, getValidator, isExpectReply, isReadable, resolveHttpStatusFromHeaders, setCrossOrigin, setRequestPayloadType, setStatusCodeExpressionString, setValidator, validateMethods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
buildErrorMessage, buildSendTimer, destroy, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackMethods 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, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, 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
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentNameMethods inherited from interface org.springframework.context.SmartLifecycle
isPauseable
-
Constructor Details
-
SnsInboundChannelAdapter
public SnsInboundChannelAdapter(software.amazon.awssdk.services.sns.SnsClient amazonSns, String... path)
-
-
Method Details
-
setHandleNotificationStatus
public void setHandleNotificationStatus(boolean handleNotificationStatus) The flag indicating if the adapter should sendSubscriptionConfirmation/UnsubscribeConfirmationmessage to the `output-channel` or not.- Parameters:
handleNotificationStatus- the flag to set. Default isfalse.
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
send
- Overrides:
sendin classorg.springframework.integration.gateway.MessagingGatewaySupport
-
setPayloadExpression
- Overrides:
setPayloadExpressionin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setHeaderExpressions
- Overrides:
setHeaderExpressionsin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setMessageConverters
- Overrides:
setMessageConvertersin classorg.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
-
setMergeWithDefaultConverters
public void setMergeWithDefaultConverters(boolean mergeWithDefaultConverters) - Overrides:
setMergeWithDefaultConvertersin classorg.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
-
setHeaderMapper
public void setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<HttpHeaders> headerMapper) - Overrides:
setHeaderMapperin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setRequestMapping
public void setRequestMapping(org.springframework.integration.http.inbound.RequestMapping requestMapping) - Overrides:
setRequestMappingin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setRequestPayloadTypeClass
- Overrides:
setRequestPayloadTypeClassin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setExtractReplyPayload
public void setExtractReplyPayload(boolean extractReplyPayload) - Overrides:
setExtractReplyPayloadin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-
setMultipartResolver
- Overrides:
setMultipartResolverin classorg.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
-
setStatusCodeExpression
- Overrides:
setStatusCodeExpressionin classorg.springframework.integration.http.inbound.BaseHttpInboundEndpoint
-