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

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

Introduction

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

Prototype

@Deprecated
public AmazonSQSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) 

Source Link

Document

Constructs a new asynchronous client to invoke service methods on Amazon SQS using the specified AWS account credentials provider and executor service.

Usage

From source file:com.github.scizeron.logback.appender.SqsAppender.java

License:Apache License

@Override
public void start() {
    try {//from  w  ww. ja  v  a2 s.  co m
        if (this.encoder == null) {
            addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this));
            return;
        }

        close();

        this.sqs = new AmazonSQSAsyncClient(getCredentials(),
                this.threadPool > 0 ? Executors.newFixedThreadPool(this.threadPool)
                        : Executors.newCachedThreadPool());
        this.sqs.setEndpoint(new URI(this.queueUrl).getHost());
        this.encoder.init(new SqsOutputStreamAdapter());

        super.start();

    } catch (Exception e) {
        addError(this.getClass() + " start failure", e);
    }
}