beam-sdks-java-io-amazon-web-services
is deprecated and will be
eventually removed. Please migrate to SnsIO
in module
beam-sdks-java-io-amazon-web-services2
.@Deprecated
public final class SnsIO
extends java.lang.Object
PTransform
s for writing to SNS.
Example usage:
PCollection<PublishRequest> data = ...;
data.apply(SnsIO.write()
.withTopicName("topicName")
.withRetryConfiguration(
SnsIO.RetryConfiguration.create(
4, org.joda.time.Duration.standardSeconds(10)))
.withAWSClientsProvider(new BasicSnsProvider(accessKey, secretKey, region))
.withResultOutputTag(results));
As a client, you need to provide at least the following things:
By default, the output PublishResult contains only the messageId, all other fields are null.
If you need the full ResponseMetadata and SdkHttpMetadata you can call SnsIO.Write.withFullPublishResult()
. If you need the HTTP status code but not the response headers you
can call SnsIO.Write.withFullPublishResultWithoutHeaders()
.
Modifier and Type | Class and Description |
---|---|
static class |
SnsIO.RetryConfiguration
Deprecated.
A POJO encapsulating a configuration for retry behavior when issuing requests to SNS.
|
static class |
SnsIO.Write
Deprecated.
Implementation of
write() . |
Constructor and Description |
---|
SnsIO()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static SnsIO.Write |
write()
Deprecated.
|
public static SnsIO.Write write()