【问题标题】:java.lang.IllegalStateException: Connection pool shut down exception from spring-integration-aws libraryjava.lang.IllegalStateException:来自 spring-integration-aws 库的连接池关闭异常
【发布时间】:2019-02-05 14:03:31
【问题描述】:

我们正在使用 spring-integration-aws-2.0.0 连接到 kinesis 以收听流。停止应用程序时,总是出现以下异常。

a.i.k.KinesisMessageDrivenChannelAdapter : Got an exception java.lang.IllegalStateException: Connection pool shut down during [ShardConsumer{shardOffset=KinesisShardOffset{iteratorType=TRIM_HORIZON, sequenceNumber='null', timestamp=null, stream='developer-entitlement-command-stream-local', shard='shardId-000000000000', reset=false}, state=CONSUME}] task invocation.
Process will be retried on the next iteration.

虽然它可能还没有造成任何数据丢失。有人遇到这个错误吗?

【问题讨论】:

    标签: java spring-boot amazon-kinesis spring-integration-aws aws-sdk-java-2.0


    【解决方案1】:

    这看起来很简单,但很烦人。

    • 停止应用程序时,请确保连接已关闭并将它们返回到池中。
    • 当应用程序关闭时,任何引用或进程都不应在后台运行。

    上面的第二个选项解决了我的问题。

    希望这会有所帮助:)

    【讨论】:

    • amazon kinesis 客户端配置为 spring bean,使用 AmazonKinesisAsyncClientBuilder.standard()..build()。因此我们不会手动打开/关闭任何连接。我在后台没有任何进程。
    猜你喜欢
    • 1970-01-01
    • 2017-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 2021-06-24
    • 2022-01-12
    • 2022-01-08
    相关资源
    最近更新 更多