我们使用 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.lang.IllegalStateException : Connection pool shut down exception from spring-integration-aws library,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54536169/