Class SnsAsyncTemplate
java.lang.Object
io.awspring.cloud.sns.core.async.SnsAsyncTemplate
- All Implemented Interfaces:
SnsAsyncOperations
Asynchronous template for SNS operations.
- Since:
- 4.1.0
- Author:
- Matej Nedic
-
Constructor Summary
ConstructorsConstructorDescriptionSnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient) SnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient, @Nullable SnsPublishMessageConverter messageConverter) SnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient, TopicArnResolver topicArnResolver, @Nullable SnsPublishMessageConverter messageConverter) -
Method Summary
Modifier and TypeMethodDescriptionconvertAndSend(String destination, T payload) Converts and sends a payload to a destination.convertAndSend(String destination, T payload, @Nullable Map<String, Object> headers) Converts and sends a payload with headers to a destination.convertAndSend(String destination, T payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) Converts and sends a payload with headers and a post processor to a destination.convertAndSend(String destination, T payload, @Nullable MessagePostProcessor postProcessor) Converts and sends a payload with a post processor to a destination.Sends a message to a destination.sendNotification(String topic, SnsNotification<T> notification) Sends a notification to a topic.sendNotification(String destinationName, Object message, @Nullable String subject) Sends a notification with a message and subject to a destination.topicExists(String topicArn) Checks if a topic with the given ARN exists.
-
Constructor Details
-
SnsAsyncTemplate
public SnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient) -
SnsAsyncTemplate
public SnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient, @Nullable SnsPublishMessageConverter messageConverter) -
SnsAsyncTemplate
public SnsAsyncTemplate(software.amazon.awssdk.services.sns.SnsAsyncClient snsAsyncClient, TopicArnResolver topicArnResolver, @Nullable SnsPublishMessageConverter messageConverter)
-
-
Method Details
-
send
Description copied from interface:SnsAsyncOperationsSends a message to a destination.- Specified by:
sendin interfaceSnsAsyncOperations- Type Parameters:
T- the message payload type- Parameters:
destination- the destination namemessage- the message to send- Returns:
- a CompletableFuture with the result
-
convertAndSend
Description copied from interface:SnsAsyncOperationsConverts and sends a payload to a destination.- Specified by:
convertAndSendin interfaceSnsAsyncOperations- Type Parameters:
T- the payload type- Parameters:
destination- the destination namepayload- the payload to send- Returns:
- a CompletableFuture with the result
-
convertAndSend
public <T> CompletableFuture<PublishMessageResult<T>> convertAndSend(String destination, T payload, @Nullable Map<String, Object> headers) Description copied from interface:SnsAsyncOperationsConverts and sends a payload with headers to a destination.- Specified by:
convertAndSendin interfaceSnsAsyncOperations- Type Parameters:
T- the payload type- Parameters:
destination- the destination namepayload- the payload to sendheaders- the headers to include- Returns:
- a CompletableFuture with the result
-
convertAndSend
public <T> CompletableFuture<PublishMessageResult<T>> convertAndSend(String destination, T payload, @Nullable MessagePostProcessor postProcessor) Description copied from interface:SnsAsyncOperationsConverts and sends a payload with a post processor to a destination.- Specified by:
convertAndSendin interfaceSnsAsyncOperations- Type Parameters:
T- the payload type- Parameters:
destination- the destination namepayload- the payload to sendpostProcessor- the post processor to apply- Returns:
- a CompletableFuture with the result
-
convertAndSend
public <T> CompletableFuture<PublishMessageResult<T>> convertAndSend(String destination, T payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) Description copied from interface:SnsAsyncOperationsConverts and sends a payload with headers and a post processor to a destination.- Specified by:
convertAndSendin interfaceSnsAsyncOperations- Type Parameters:
T- the payload type- Parameters:
destination- the destination namepayload- the payload to sendheaders- the headers to includepostProcessor- the post processor to apply- Returns:
- a CompletableFuture with the result
-
sendNotification
public CompletableFuture<PublishMessageResult<Object>> sendNotification(String destinationName, Object message, @Nullable String subject) Description copied from interface:SnsAsyncOperationsSends a notification with a message and subject to a destination.- Specified by:
sendNotificationin interfaceSnsAsyncOperations- Parameters:
destinationName- the destination namemessage- the message to sendsubject- the subject (can be null)- Returns:
- a CompletableFuture with the result
-
sendNotification
public <T> CompletableFuture<PublishMessageResult<T>> sendNotification(String topic, SnsNotification<T> notification) Description copied from interface:SnsAsyncOperationsSends a notification to a topic.- Specified by:
sendNotificationin interfaceSnsAsyncOperations- Type Parameters:
T- the notification payload type- Parameters:
topic- the topic namenotification- the notification to send- Returns:
- a CompletableFuture with the result
-
topicExists
Description copied from interface:SnsAsyncOperationsChecks if a topic with the given ARN exists.- Specified by:
topicExistsin interfaceSnsAsyncOperations- Parameters:
topicArn- the ARN of the topic- Returns:
- a CompletableFuture with true if the topic exists, false otherwise
-