2015-09-29 86 views
2

我正在嘗試從AWS實現Dynamodb Streams Java示例。我多次重複出現以下2個錯誤,然後程序按預期完成。任何想法是什麼原因?DynamoDB Streams異常

[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] 
+0

so'describeStream'產生'UnknownOperationException'?您是否使用aws sdk的過時版本?編輯:nope,1.10.20是最近的。 – zapl

回答

1

我們遇到了同樣的問題,結果發現我們在設置中缺少區域,明確設置區域使其工作。

對於dynamodb-local,你不需要區域,所以使用它可以在沒有區域的情況下工作,然後當你在AWS中部署它時,你會得到上述錯誤。

0

@ mikeal-sundberg提供的答案對我不起作用,我最終認爲這是由於AWS與Dynamo本地提供的端點不同。

使用Dynamo local,您可以爲標準的Dynamo客戶端以及AmazonDynamoDBStreams客戶端使用相同的端點。部署時,AmazonDynamoDBStreams客戶端需要一個特定於流的端點,如https://streams.dynamodb.eu-west-1.amazonaws.com