我得到这个:
com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException:
The security token included in the request is invalid. (Service:
AmazonDynamoDBv2; Status Code: 400;
当我尝试bootRun
我的java / spring kinesis消费者应用程序
我将DynamoDBFullAccess策略添加到用户权限中,并通过编写列出表的短节点应用程序测试了我的凭据。它能够成功列出表,所以我知道我的凭据不是这里的问题。
这是我在应用程序中设置凭据的方式:
BasicAWSCredentials creds = new
BasicAWSCredentials(appConfig.getAwsKeyId(),
appConfig.getAwsAccessKey());
KinesisClientLibConfiguration config = new
KinesisClientLibConfiguration(
appConfig.getApplicationName(),
appConfig.getConsumerStreamName(),
new AWSStaticCredentialsProvider(creds),
appConfig.getWorkerName());
下面的worker.run()行是引发错误的地方:
Worker worker = new Worker.Builder()
.config(getKinesisConfig())
.recordProcessorFactory(kinesisFactory)
.build();
worker.run();
有人碰到过吗?我应该如何进一步排除故障?