@Experimental(value=SOURCE_SINK) public final class SnsIO extends java.lang.Object
PTransform
s for writing to SNS.
Example usage:
PCollection<String> data = ...;
data.apply(SnsIO.<String>write()
.withPublishRequestFn(m -> PublishRequest.builder().topicArn("topicArn").message(m).build())
.withTopicArn("topicArn")
.withRetryConfiguration(
SnsIO.RetryConfiguration.create(
4, org.joda.time.Duration.standardSeconds(10)))
.withSnsClientProvider(new BasicSnsClientProvider(awsCredentialsProvider, region));
As a client, you need to provide at least the following things:
Modifier and Type | Class and Description |
---|---|
static class |
SnsIO.RetryConfiguration
A POJO encapsulating a configuration for retry behavior when issuing requests to SNS.
|
static class |
SnsIO.Write<T>
Implementation of
write() . |
Constructor and Description |
---|
SnsIO() |
Modifier and Type | Method and Description |
---|---|
static <T> SnsIO.Write<T> |
write() |
public static <T> SnsIO.Write<T> write()