Java 类com.amazonaws.services.sqs.AmazonSQSAsyncClientBuilder 实例源码

项目:aws-codecommit-trigger-plugin    文件:SQSFactoryImpl.java   
private AmazonSQSAsyncClientBuilder createStandardAsyncClientBuilder(SQSQueue queue, AWSCredentialsProvider credentials) {
    ClientConfiguration clientConfiguration = this.getClientConfiguration(queue);
    AmazonSQSAsyncClientBuilder builder = AmazonSQSAsyncClientBuilder.standard()
        .withClientConfiguration(clientConfiguration)
        .withCredentials(credentials)
        .withExecutorFactory(this.SQSExecutorFactory);

    if (queue != null) {
        Regions region = queue.getRegion();
        if (region != null) {
            builder.withRegion(region);
        }
    }

    return builder;
}
项目:webcrawler    文件:AppConfig.java   
@Bean
public AmazonSQSAsync getSQSClient() {

    return AmazonSQSAsyncClientBuilder.standard()
            .withCredentials(new ProfileCredentialsProvider(CREDENTIALS_PROVIDER))
            .withRegion(Regions.AP_SOUTHEAST_2)
            .build();

}
项目:unitstack    文件:MockSqsTest.java   
@Before
public void setup() {
  mockSqs(null);

  EndpointConfiguration endpoint =
      new EndpointConfiguration(UNIT_STACK_URL + ":" + SQS_PORT, "eu-central-1");
  AWSCredentials credentials = new BasicAWSCredentials("key", "secret");
  AWSCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);

  sqs = AmazonSQSAsyncClientBuilder.standard().withEndpointConfiguration(endpoint)
      .withCredentials(credentialsProvider).build();
}
项目:aws-codecommit-trigger-plugin    文件:SQSFactoryImpl.java   
@Override
public AmazonSQS createSQSAsync(final SQSQueue queue) {
    AWSCredentialsProvider credentials = queue.hasCredentials() ? queue.lookupAwsCredentials() : DefaultAWSCredentialsProviderChain.getInstance();
    AmazonSQSAsyncClientBuilder sqsAsyncBuilder = createStandardAsyncClientBuilder(queue, credentials);
    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(queue);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsyncBuilder.build(), queueBufferConfig);
    return sqsBufferedAsync;
}
项目:aws-codecommit-trigger-plugin    文件:SQSFactoryImpl.java   
@Override
public AmazonSQS createSQSAsync(String accessKey, String secretKey) {
    AmazonSQSAsyncClientBuilder sqsAsyncBuilder = createStandardAsyncClientBuilder(null, new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)));
    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(null);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsyncBuilder.build(), queueBufferConfig);
    return sqsBufferedAsync;
}
项目:aws-codecommit-trigger-plugin    文件:SQSFactoryImpl.java   
public AmazonSQS createSQSAsync(String accessKey, String secretKey, String region) {//TODO check region is Enum?
    AmazonSQSAsyncClientBuilder sqsAsyncBuilder = createStandardAsyncClientBuilder(null, new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)));
    if (StringUtils.isNotBlank(region)) {
        sqsAsyncBuilder.withRegion(Regions.valueOf(region));
    }
    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(null);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsyncBuilder.build(), queueBufferConfig);
    return sqsBufferedAsync;
}
项目:zipkin-aws    文件:SQSSender.java   
@Memoized AmazonSQSAsync get() {
  AmazonSQSAsync result = AmazonSQSAsyncClientBuilder.standard()
      .withCredentials(credentialsProvider())
      .withEndpointConfiguration(endpointConfiguration()).build();
  provisioned = true;
  return result;
}
项目:datacollector    文件:SqsConsumer.java   
private AmazonSQSAsync buildAsyncClient() {
  final AmazonSQSAsyncClientBuilder builder = AmazonSQSAsyncClientBuilder.standard();
  builder.setRegion(conf.region.getLabel());
  builder.setCredentials(credentials);
  builder.setClientConfiguration(clientConfiguration);
  return builder.build();
}