[英]How to configure idleWaitTime Environment Variable in QuartzScheduler for Spring Framework
I currently am using a third party application that uses the spring framework and am trying to troubleshoot an issue where something in the spring framework keeps recreating a connection every 30 seconds to a serverless postgres database in AWS.我目前正在使用使用 spring 框架的第三方应用程序,并试图解决一个问题,即 spring 框架中的某些内容每 30 秒不断重新创建与 AWS 中的无服务器 postgres 数据库的连接。 I am using a Hikari datasource that has been configured with the following environment variables:
我正在使用配置了以下环境变量的 Hikari 数据源:
DATASOURCE_MINIMUMIDLE=0
DATASOURCE_IDLETIMEOUT=30000
DATASOURCE_MAXLIFETIME=60000
I have confirmed these settings are modifying the hikari pool as expected.我已经确认这些设置正在按预期修改 hikari 池。
Investigating the issue, I found that Quartz is scheduling a query every 30 seconds or so.调查这个问题,我发现 Quartz 每 30 秒左右安排一次查询。 I've tried setting the env var to control the idle timeout for the main scheduler loop:
我已经尝试设置 env var 来控制主调度程序循环的空闲超时:
https://github.com/quartz-scheduler/quartz/blob/9f9e400733f51f7cb658e3319fc2c140ab8af938/quartz-core/src/main/java/org/quartz/core/QuartzSchedulerThread.java#L244 https://github.com/quartz-scheduler/quartz/blob/9f9e400733f51f7cb658e3319fc2c140ab8af938/quartz-core/src/main/java/org/quartz/core/QuartzSchedulerThread.java#L244
Either the env var I'm trying to set to control the idleWaitTime is incorrect or something else is going on.我试图设置以控制 idleWaitTime 的 env var 不正确,或者正在发生其他事情。
Does anyone have experience controlling the quartz idleWaitTime with the environment variables?有没有人有使用环境变量控制石英 idleWaitTime 的经验?
I've tried SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_IDLEWAITTIME, but that does not seem to have any effect.我试过 SPRING_QUARTZ_PROPERTIES_ORG_QUARTZ_SCHEDULER_IDLEWAITTIME,但这似乎没有任何效果。
我通过使用以下设置 SPRING_APPLICATION_JSON 环境变量解决了这个问题: "{\\"spring\\":{\\"application\\":{\\"quartz\\":{\\"org.quartz.scheduler.idleWaitTime\\":\\"600000\\"}}}}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.