use of com.amazonaws.ClientConfiguration in project aws-xray-sdk-java by aws.
the class XRayClient method newClient.
/**
* @deprecated aws-xray-recorder only supports communicating with the X-Ray daemon, which does
* not require the usual AWS API signatures so we have stopped using the SDK X-Ray client.
*/
@Deprecated
public static AWSXRay newClient() {
DaemonConfiguration config = new DaemonConfiguration();
ClientConfiguration clientConfig = new ClientConfiguration().withRequestTimeout(TIME_OUT);
AwsClientBuilder.EndpointConfiguration endpointConfig = new AwsClientBuilder.EndpointConfiguration(config.getEndpointForTCPConnection(), DUMMY_REGION);
return AWSXRayClientBuilder.standard().withEndpointConfiguration(endpointConfig).withClientConfiguration(clientConfig).withCredentials(// This will entirely skip signing too
ANONYMOUS_CREDENTIALS).build();
}
use of com.amazonaws.ClientConfiguration in project bender by Nextdoor.
the class FirehoseTransportFactory method setConf.
@Override
public void setConf(AbstractConfig config) {
this.config = (FirehoseTransportConfig) config;
this.serializer = new FirehoseTransportSerializer(this.config.getAppendNewline());
this.client = new AmazonKinesisFirehoseClient(new ClientConfiguration().withGzip(true));
if (this.config.getRegion() != null) {
this.client.withRegion(this.config.getRegion());
}
}
use of com.amazonaws.ClientConfiguration in project kork by spinnaker.
the class SNSPublisherProvider method start.
@PostConstruct
public void start() {
if (properties == null) {
return;
}
List<PubsubPublisher> publishers = new ArrayList<>();
properties.getSubscriptions().forEach((AmazonPubsubProperties.AmazonPubsubSubscription subscription) -> {
ARN topicARN = new ARN(subscription.getTopicARN());
log.info("Bootstrapping SNS topic: {}", topicARN);
AmazonSNS amazonSNS = AmazonSNSClientBuilder.standard().withCredentials(awsCredentialsProvider).withClientConfiguration(new ClientConfiguration()).withRegion(topicARN.getRegion()).build();
Supplier<Boolean> isEnabled = PubSubUtils.getEnabledSupplier(dynamicConfig, subscription, discoveryStatus);
SNSPublisher publisher = new SNSPublisher(subscription, amazonSNS, isEnabled, registry, retrySupport);
publishers.add(publisher);
});
pubsubPublishers.putAll(publishers);
}
use of com.amazonaws.ClientConfiguration in project kork by spinnaker.
the class SQSSubscriberProvider method start.
@PostConstruct
public void start() {
Preconditions.checkNotNull(properties, "Can't initialize SQSSubscriberProvider with null properties");
ExecutorService executorService = Executors.newFixedThreadPool(properties.getSubscriptions().size());
List<PubsubSubscriber> subscribers = new ArrayList<>();
properties.getSubscriptions().forEach((AmazonPubsubProperties.AmazonPubsubSubscription subscription) -> {
log.info("Bootstrapping SQS for SNS topic: {}", subscription.getTopicARN());
ARN queueArn = new ARN(subscription.getQueueARN());
ARN topicArn = new ARN(subscription.getTopicARN());
SQSSubscriber worker = new SQSSubscriber(subscription, pubsubMessageHandlerFactory.create(subscription), messageAcknowledger, AmazonSNSClientBuilder.standard().withCredentials(awsCredentialsProvider).withClientConfiguration(new ClientConfiguration()).withRegion(topicArn.getRegion()).build(), AmazonSQSClientBuilder.standard().withCredentials(awsCredentialsProvider).withClientConfiguration(new ClientConfiguration()).withRegion(queueArn.getRegion()).build(), PubSubUtils.getEnabledSupplier(dynamicConfig, subscription, discoveryStatus), registry);
try {
executorService.submit(worker);
subscribers.add(worker);
log.debug("Created worker {} for subscription: {}", worker.getWorkerName(), subscription.getName());
} catch (RejectedExecutionException e) {
log.error("Could not start {}", worker.getWorkerName(), e);
}
});
pubsubSubscribers.putAll(subscribers);
}
use of com.amazonaws.ClientConfiguration in project presto by prestodb.
the class TestPrestoS3FileSystem method testUserAgentPrefix.
@Test
public void testUserAgentPrefix() throws Exception {
String userAgentPrefix = "agent_prefix";
Configuration config = new Configuration();
config.set(S3_USER_AGENT_PREFIX, userAgentPrefix);
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
ClientConfiguration clientConfig = getFieldValue(fs.getS3Client(), AmazonWebServiceClient.class, "clientConfiguration", ClientConfiguration.class);
assertEquals(clientConfig.getUserAgentSuffix(), S3_USER_AGENT_SUFFIX);
assertEquals(clientConfig.getUserAgentPrefix(), userAgentPrefix);
}
}
Aggregations