【发布时间】:2019-06-27 13:13:53
【问题描述】:
我们有一个非常简单的 spring-cloud-stream 应用程序,它从 AWS-Kinesis 队列中读取数据。它已经工作了一段时间没有问题。它的工作量很小。
今天,我们每秒收到 100 多个异常。 (这比我们在这个应用上的用户还多,所以它看起来像一个无限的重试循环)
WARN --- [s-shard-locks-1] c.a.s.d.AmazonDynamoDBLockClient :
Could not acquire lock because of a client side failure in talking to DDB
com.amazonaws.services.dynamodbv2.model.ProvisionedThroughputExceededException:
The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API. (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ProvisionedThroughputExceededException
...
at org.springframework.integration.aws.lock.DynamoDbLockRegistry$DynamoDbLock.doLock(DynamoDbLockRegistry.java:504)
代码很简单:
@StreamListener(Channels.OUR_CHANNEL)
fun consumeThing(Thing: MutableMap<Any, Any>) {
log.info("thing received: {}.", thing)
// some methods to write it to our own datbase
}
我们只有一个基本的配置:
spring:
cloud:
stream:
defaultBinder: kinesis
bindings:
thingsChannel:
group: aGroup
destination: aDestionation
在 AWS-Console 中,我们看到一条警告,指出在 DynamoBD 中 SpringIntegrationLockRegistry 超出了读取容量。我们把它从 1 放到 10,但还是有问题。
如何配置 spring-data-cloud 和 kinesis 使其更具弹性,并且在没有等待时间的情况下不要重试?
【问题讨论】:
标签: spring-cloud-stream amazon-kinesis