【问题标题】:Spring cloud stream with kinesis: AmazonDynamoDBLockClient thows excpetions in loopSpring Cloud Stream with kinesis:AmazonDynamoDBLockClient 在循环中抛出异常
【发布时间】: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


    【解决方案1】:

    请查看LockRegistry 的可能选项:https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/blob/master/spring-cloud-stream-binder-kinesis-docs/src/main/asciidoc/overview.adoc#lockregistry

    AWS 控制台中表格上的策略似乎已更改。您可能需要重新考虑该表或我提到的客户端的一些超时和读写容量。

    您可以阅读更多关于 DynamoDB Lock Client 的更多信息here,它已经不受 Spring Cloud Stream 控制。顺便说一句,这是项目的名称,而不是 data...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-15
      • 1970-01-01
      • 2019-02-05
      • 1970-01-01
      • 1970-01-01
      • 2017-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多