com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder Java Examples

The following examples show how to use com.amazonaws.services.kinesis.AmazonKinesisAsyncClientBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CloudStreamKinesisToWebfluxApplicationTests.java    From spring-cloud-stream-samples with Apache License 2.0 6 votes vote down vote up
@Bean
public AmazonKinesisAsync amazonKinesis() {
	// See https://github.com/mhart/kinesalite#cbor-protocol-issues-with-the-java-sdk
	System.setProperty(SDKGlobalConfiguration.AWS_CBOR_DISABLE_SYSTEM_PROPERTY, "true");

	return AmazonKinesisAsyncClientBuilder.standard()
			.withClientConfiguration(
					new ClientConfiguration()
							.withMaxErrorRetry(0)
							.withConnectionTimeout(1000))
			.withEndpointConfiguration(
					new AwsClientBuilder.EndpointConfiguration("http://localhost:" + DEFAULT_KINESALITE_PORT,
							Regions.DEFAULT_REGION.getName()))
			.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials("", "")))
			.build();
}
 
Example #2
Source File: AmazonAsyncDockerClientsHolder.java    From spring-localstack with Apache License 2.0 5 votes vote down vote up
@Override
public AmazonKinesisAsync amazonKinesis() {
    return decorateWithConfigsAndBuild(
        AmazonKinesisAsyncClientBuilder.standard(),
        LocalstackDocker::getEndpointKinesis
    );
}
 
Example #3
Source File: KinesisBinderConfiguration.java    From spring-cloud-stream-binder-aws-kinesis with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public AmazonKinesisAsync amazonKinesis() {
	return AmazonKinesisAsyncClientBuilder.standard()
			.withCredentials(this.awsCredentialsProvider)
			.withRegion(this.region)
			.build();
}
 
Example #4
Source File: ExtendedDockerTestUtils.java    From spring-cloud-stream-binder-aws-kinesis with Apache License 2.0 5 votes vote down vote up
public static AmazonKinesisAsync getClientKinesisAsync() {
	AmazonKinesisAsyncClientBuilder amazonKinesisAsyncClientBuilder =
			AmazonKinesisAsyncClientBuilder.standard()
					.withEndpointConfiguration(
							createEndpointConfiguration(LocalstackDocker.INSTANCE::getEndpointKinesis));
	return applyConfigurationAndBuild(amazonKinesisAsyncClientBuilder);
}
 
Example #5
Source File: KinesisSender.java    From zipkin-aws with Apache License 2.0 5 votes vote down vote up
AmazonKinesisAsync get() {
  if (asyncClient == null) {
    synchronized (this) {
      if (asyncClient != null) return asyncClient;
      AmazonKinesisAsyncClientBuilder builder = AmazonKinesisAsyncClientBuilder.standard()
          .withCredentials(credentialsProvider)
          .withEndpointConfiguration(endpointConfiguration);
      if (region != null) builder.withRegion(region);
      asyncClient = builder.build();
    }
  }
  return asyncClient;
}