List of usage examples for com.amazonaws.services.sns AmazonSNSAsyncClient asyncBuilder
public static AmazonSNSAsyncClientBuilder asyncBuilder()
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); } }