24.6. 使用方法
24.6.1. AmazonDynamoDBStreamsClient configuration
您需要创建一个 AmazonDynamoDBStreamsClient 实例,并将其绑定到 registry
ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setProxyHost("http://myProxyHost"); clientConfiguration.setProxyPort(8080); Region region = Region.getRegion(Regions.fromName(region)); region.createClient(AmazonDynamoDBStreamsClient.class, null, clientConfiguration); // the 'null' here is the AWSCredentialsProvider which defaults to an instance of DefaultAWSCredentialsProviderChain registry.bind("kinesisClient", client);
24.6.2. 提供 AWS 凭证
建议使用 DefaultAWSCredentialsProviderChain 获取凭证,这是创建新 ClientConfiguration 实例时的默认设置,但在调用 createClient (…)时可以指定不同的 AWSCredentialsProvider。