![](/img/trans.png)
[英]How can I create a GCP service account with assigned role that will only be valid for a certain period of time?
[英]How to stop a service or a kafka consumer after it has been idle for a certain period of time?
我有一个作为服务持续运行的 Kafka 消费者。 我注意到它只在白天运行一段时间。 我不想让它持续运行,而是想为消费者设置某种轮询超时。
如果消费者没有消费任何东西/闲置 10 分钟,那么我想关闭该服务。 我可以使用 Kafka 中的某种轮询超时和信号机制吗?
请参阅ListenerContainerIdleEvent
和相应的容器属性及其文档: https://docs.spring.io/spring-kafka/docs/current/reference/html/#idleEventInterval
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.