您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何使用@RabbitListener优雅地停止使用消息

如何使用@RabbitListener优雅地停止使用消息

增加关闭超时。

请参阅消息侦听器容器配置

当容器关闭时(例如,如果关闭了其封闭的ApplicationContext),它将等待处理运行中的消息直至达到此限制。认为五秒钟。

/**
 * The time to wait for workers in milliseconds after the container is stopped. If any
 * workers are active when the shutdown signal comes they will be allowed to finish
 * processing as long as they can finish within this timeout. Defaults
 * to 5 seconds.
 * @param shutdownTimeout the shutdown timeout to set
 */
public void setShutdownTimeout(long shutdownTimeout) {
其他 2022/1/1 18:25:23 有546人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶