io.camunda.connector.common.suppliers.DefaultAmazonSQSClientSupplier Maven / Gradle / Ivy
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. Licensed under a proprietary license.
* See the License.txt file for more information. You may not use this file
* except in compliance with the proprietary license.
*/
package io.camunda.connector.common.suppliers;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSClientBuilder;
public class DefaultAmazonSQSClientSupplier implements AmazonSQSClientSupplier {
public AmazonSQS sqsClient(
final AWSCredentialsProvider credentialsProvider, final String region) {
return AmazonSQSClientBuilder.standard()
.withCredentials(credentialsProvider)
.withRegion(region)
.build();
}
public AmazonSQS sqsClient(
final AWSCredentialsProvider credentialsProvider,
final String region,
final String endpoint) {
return AmazonSQSClientBuilder.standard()
.withCredentials(credentialsProvider)
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy