当我已经拥有 max.Queue.poolSize 时,Hystrix 中的 queueSizeRejectionThreshold 有什么用?
What is use of queueSizeRejectionThreshold in Hystrix when i am already having max.Queue.poolSize ?
为什么我们在 Hystrix 中除了 maxQueueSize 之外还需要 queueSizeRejectionThreshold。
根据定义,queueSizeRejectionThreshold <= maxQueueSize
。但我不明白为什么在 maxQueueSize
变满时不拒绝线程,为什么要引入术语 queueSizeRejectionThreshold
.
documentation解释了您可能需要queueSizeRejectionThreshold
的原因:
This property exists because the maxQueueSize of a BlockingQueue cannot be dynamically changed and we want to allow you to dynamically change the queue size that affects rejections.
如果您不想动态更改队列大小(在 运行 时间内),只需设置 maxQueueSize = queueSizeRejectionThreshold
.
为什么我们在 Hystrix 中除了 maxQueueSize 之外还需要 queueSizeRejectionThreshold。
根据定义,queueSizeRejectionThreshold <= maxQueueSize
。但我不明白为什么在 maxQueueSize
变满时不拒绝线程,为什么要引入术语 queueSizeRejectionThreshold
.
documentation解释了您可能需要queueSizeRejectionThreshold
的原因:
This property exists because the maxQueueSize of a BlockingQueue cannot be dynamically changed and we want to allow you to dynamically change the queue size that affects rejections.
如果您不想动态更改队列大小(在 运行 时间内),只需设置 maxQueueSize = queueSizeRejectionThreshold
.