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

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

Introduction

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

Prototype

@Deprecated
void setEndpoint(String endpoint);

Source Link

Document

Overrides the default endpoint for this client ("https://sqs.us-east-1.amazonaws.com").

Usage

From source file:io.relution.jenkins.awssqs.factories.SQSFactoryImpl.java

License:Apache License

@Override
public AmazonSQSAsync createSQSAsync(final io.relution.jenkins.awssqs.interfaces.SQSQueue queue) {
    final ClientConfiguration clientConfiguration = this.getClientConfiguration(queue);
    boolean hasCredentials = isNotBlank(queue.getAWSAccessKeyId()) && isNotBlank(queue.getAWSSecretKey());
    io.relution.jenkins.awssqs.logging.Log.info("Creating AmazonSQS instance - hasCredentials='%s'",
            hasCredentials);//from  w  ww  .  j  a  v  a 2s  .com
    final AmazonSQSAsyncClient sqsAsync = hasCredentials
            ? new AmazonSQSAsyncClient(queue, clientConfiguration, this.executor)
            : new AmazonSQSAsyncClient(clientConfiguration);

    if (queue.getEndpoint() != null) {
        sqsAsync.setEndpoint(queue.getEndpoint());
    }

    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(queue);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsync,
            queueBufferConfig);

    return sqsBufferedAsync;
}

From source file:io.relution.jenkins.scmsqs.factories.SQSFactoryImpl.java

License:Apache License

@Override
public AmazonSQSAsync createSQSAsync(final SQSQueue queue) {
    final ClientConfiguration clientConfiguration = this.getClientConfiguration(queue);
    final AmazonSQSAsyncClient sqsAsync = new AmazonSQSAsyncClient(queue, clientConfiguration, this.executor);

    if (queue.getEndpoint() != null) {
        sqsAsync.setEndpoint(queue.getEndpoint());
    }//from   w w  w.j a va  2 s.c o m

    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(queue);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsync,
            queueBufferConfig);

    return sqsBufferedAsync;
}