Example usage for com.amazonaws.services.sqs AmazonSQSAsyncClient setRegion

List of usage examples for com.amazonaws.services.sqs AmazonSQSAsyncClient setRegion

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs AmazonSQSAsyncClient setRegion.

Prototype

@Deprecated
void setRegion(Region region);

Source Link

Document

An alternative to AmazonSQS#setEndpoint(String) , sets the regional endpoint for this client's service calls.

Usage

From source file:org.apache.usergrid.persistence.queue.impl.SNSQueueManagerImpl.java

License:Apache License

/**
 * Create the async sqs client/*from  w w  w .ja v  a 2 s.c om*/
 */
private AmazonSQSAsyncClient createAsyncSQSClient(final Region region, final ExecutorService executor) {

    final UsergridAwsCredentialsProvider ugProvider = new UsergridAwsCredentialsProvider();
    final AmazonSQSAsyncClient sqs = new AmazonSQSAsyncClient(ugProvider.getCredentials(), clientConfiguration,
            executor);

    sqs.setRegion(region);

    return sqs;
}

From source file:org.springframework.cloud.aws.messaging.config.annotation.SqsClientConfiguration.java

License:Apache License

@Lazy
@Bean(destroyMethod = "shutdown")
public AmazonSQSAsync amazonSQS() {
    AmazonSQSAsyncClient amazonSQSAsyncClient;
    if (this.awsCredentialsProvider != null) {
        amazonSQSAsyncClient = new AmazonSQSAsyncClient(this.awsCredentialsProvider);
    } else {/*from  w w  w .j  a v  a  2  s.c o m*/
        amazonSQSAsyncClient = new AmazonSQSAsyncClient();
    }

    if (this.regionProvider != null) {
        amazonSQSAsyncClient.setRegion(this.regionProvider.getRegion());
    }

    return new AmazonSQSBufferedAsyncClient(amazonSQSAsyncClient);
}