use of com.amazonaws.services.sqs.AmazonSQSClientBuilder in project opennms by OpenNMS.
the class DefaultAmazonSQSManager method createSQSClient.
private AmazonSQS createSQSClient() {
final AmazonSQSClientBuilder builder = AmazonSQSClientBuilder.standard().withRegion(sqsConfig.getRegion());
if (sqsConfig.hasStaticCredentials()) {
final BasicAWSCredentials awsCreds = new BasicAWSCredentials(sqsConfig.getAccessKey(), sqsConfig.getSecretKey());
builder.withCredentials(new AWSStaticCredentialsProvider(awsCreds));
}
if (sqsConfig.isUseHttp()) {
final ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProtocol(Protocol.HTTP);
builder.withClientConfiguration(clientConfig);
}
return builder.build();
}
Aggregations