public class SnsInboundChannelAdapter
extends org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway
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 the provided MessagingGatewaySupport.getRequestChannel(). If that, the
AwsHeaders.NOTIFICATION_STATUS 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
AwsHeaders.SNS_MESSAGE_TYPE header is present.
activeCount, JAXB_PRESENT, NON_READABLE_BODY_HTTP_METHODS, ROME_TOOLS_PRESENTmessagingTemplatelifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| Constructor and Description |
|---|
SnsInboundChannelAdapter(AmazonSNS amazonSns,
java.lang.String... path) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getComponentType() |
protected void |
onInit() |
protected void |
send(java.lang.Object object) |
void |
setExtractReplyPayload(boolean extractReplyPayload) |
void |
setHandleNotificationStatus(boolean handleNotificationStatus) |
void |
setHeaderExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> headerExpressions) |
void |
setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper) |
void |
setMergeWithDefaultConverters(boolean mergeWithDefaultConverters) |
void |
setMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters) |
void |
setMultipartResolver(org.springframework.web.multipart.MultipartResolver multipartResolver) |
void |
setPayloadExpression(org.springframework.expression.Expression payloadExpression) |
void |
setRequestMapping(org.springframework.integration.http.inbound.RequestMapping requestMapping) |
void |
setRequestPayloadTypeClass(java.lang.Class<?> requestPayloadType) |
void |
setStatusCodeExpression(org.springframework.expression.Expression statusCodeExpression) |
handleRequest, setConvertExceptionsdoHandleRequest, extractRequestBody, getMessageConverters, prepareRequest, prepareRequestEntity, setStatusCodeIfNeeded, setupResponseAndConvertReplyafterShutdown, beforeShutdown, createEvaluationContext, evaluateHttpStatus, getCrossOrigin, getExtractReplyPayload, getHeaderExpressions, getHeaderMapper, getIntegrationPatternType, getPayloadExpression, getRequestMapping, getRequestPayloadType, getStatusCodeExpression, getValidator, isExpectReply, isReadable, resolveHttpStatusFromHeaders, setCrossOrigin, setRequestPayloadType, setStatusCodeExpressionString, setValidator, validatebuildErrorMessage, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getManagedName, getManagedType, getMessageCount, getMessageCountLong, getOverrides, getReplyChannel, getRequestChannel, isCountsEnabled, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerReplyMessageCorrelatorIfNecessary, reset, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, setCountsEnabled, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBeanName, getComponentNamepublic SnsInboundChannelAdapter(AmazonSNS amazonSns, java.lang.String... path)
public void setHandleNotificationStatus(boolean handleNotificationStatus)
protected void onInit()
onInit in class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupportpublic java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointprotected void send(java.lang.Object object)
send in class org.springframework.integration.gateway.MessagingGatewaySupportpublic void setPayloadExpression(org.springframework.expression.Expression payloadExpression)
setPayloadExpression in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setHeaderExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> headerExpressions)
setHeaderExpressions in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
setMessageConverters in class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupportpublic void setMergeWithDefaultConverters(boolean mergeWithDefaultConverters)
setMergeWithDefaultConverters in class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupportpublic void setHeaderMapper(org.springframework.integration.mapping.HeaderMapper<org.springframework.http.HttpHeaders> headerMapper)
setHeaderMapper in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setRequestMapping(org.springframework.integration.http.inbound.RequestMapping requestMapping)
setRequestMapping in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setRequestPayloadTypeClass(java.lang.Class<?> requestPayloadType)
setRequestPayloadTypeClass in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setExtractReplyPayload(boolean extractReplyPayload)
setExtractReplyPayload in class org.springframework.integration.http.inbound.BaseHttpInboundEndpointpublic void setMultipartResolver(org.springframework.web.multipart.MultipartResolver multipartResolver)
setMultipartResolver in class org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupportpublic void setStatusCodeExpression(org.springframework.expression.Expression statusCodeExpression)
setStatusCodeExpression in class org.springframework.integration.http.inbound.BaseHttpInboundEndpoint