Search in sources :

Example 1 with AmazonSQSClientBuilder

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();
}
Also used : AWSStaticCredentialsProvider(com.amazonaws.auth.AWSStaticCredentialsProvider) AmazonSQSClientBuilder(com.amazonaws.services.sqs.AmazonSQSClientBuilder) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) ClientConfiguration(com.amazonaws.ClientConfiguration)

Aggregations

ClientConfiguration (com.amazonaws.ClientConfiguration)1 AWSStaticCredentialsProvider (com.amazonaws.auth.AWSStaticCredentialsProvider)1 BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)1 AmazonSQSClientBuilder (com.amazonaws.services.sqs.AmazonSQSClientBuilder)1