Example usage for com.amazonaws.services.sns AmazonSNSAsyncClient asyncBuilder

List of usage examples for com.amazonaws.services.sns AmazonSNSAsyncClient asyncBuilder

Introduction

In this page you can find the example usage for com.amazonaws.services.sns AmazonSNSAsyncClient asyncBuilder.

Prototype

public static AmazonSNSAsyncClientBuilder asyncBuilder() 

Source Link

Usage

From source file:com.adeptj.modules.aws.sns.internal.AwsSnsService.java

License:Apache License

@Activate
protected void start(SmsConfig smsConfig) {
    this.smsAttributes = new HashMap<>();
    this.smsAttributes.put("AWS.SNS.SMS.SenderID",
            new MessageAttributeValue().withStringValue(smsConfig.senderId()).withDataType("String"));
    this.smsAttributes.put("AWS.SNS.SMS.SMSType",
            new MessageAttributeValue().withStringValue(smsConfig.smsType()).withDataType("String"));
    try {//from   w  w  w  .j  a v  a2s . c om
        this.asyncSNS = AmazonSNSAsyncClient.asyncBuilder()
                .withEndpointConfiguration(
                        AwsUtil.getEndpointConfig(smsConfig.serviceEndpoint(), smsConfig.signingRegion()))
                .withCredentials(AwsUtil.getCredentialsProvider(smsConfig.accessKey(), smsConfig.secretKey()))
                .build();
    } catch (Exception ex) {
        LOGGER.error("Exception while starting SmsService!!", ex);
        throw new AwsException(ex.getMessage(), ex);
    }
}