DynamoDB Streams异常

时间:2015-09-29 20:18:55

标签: java amazon-dynamodb

我正在尝试从AWS实施Dynamodb Streams Java示例。我多次重复以下2个错误,然后程序按预期完成。任何想法是什么原因?

[error] c.a.s.k.c.l.w.ShardSyncTask - Caught exception while sync'ing Kinesis shards and leases
com.amazonaws.AmazonServiceException: null (Service: AmazonDynamoDBStreams; Status Code: 400; Error Code: UnknownOperationException; Request ID: VEPKVGT3GN8BSBP3A74LOEVIPVVV4KQNSO5AEMVJF66Q9ASUAAJG)
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.invoke(AmazonDynamoDBStreamsClient.java:638) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.describeStream(AmazonDynamoDBStreamsClient.java:363) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
[error] c.a.s.d.s.m.AmazonServiceExceptionTransformer - Could not transform a DynamoDB AmazonServiceException to a compatible Kinesis exception
com.amazonaws.AmazonServiceException: null (Service: AmazonDynamoDBStreams; Status Code: 400; Error Code: UnknownOperationException; Request ID: JLVS3D8Q363LGGI60O42LDULBFVV4KQNSO5AEMVJF66Q9ASUAAJG)
    at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310) ~[aws-java-sdk-core-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.invoke(AmazonDynamoDBStreamsClient.java:638) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]
    at com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient.describeStream(AmazonDynamoDBStreamsClient.java:363) ~[aws-java-sdk-dynamodb-1.10.20.jar:na]

2 个答案:

答案 0 :(得分:3)

我们遇到了同样的问题,结果发现我们在设置中错过了区域,明确设置区域使其工作。

对于dynamodb-local,你不需要一个区域,所以使用它可以在没有区域的情况下工作,然后当你在AWS中部署它时,你将得到上述错误。

答案 1 :(得分:0)

@ mikeal-sundberg提供的答案对我不起作用,我最终认为这与AWS与Dynamo local提供的端点之间存在差异。

使用Dynamo local,您可以为标准Dynamo客户端和AmazonDynamoDBStreams客户端使用相同的端点。部署后,AmazonDynamoDBStreams客户端需要特定于流的端点,例如https://streams.dynamodb.eu-west-1.amazonaws.com