Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.3.1
-
None
Description
It seems something wrong with logic of the following method in DeliveryChannelImpl.java file:
protected void throttle() { if (component.isExchangeThrottling()) { if (component.getThrottlingInterval() > intervalCount) { intervalCount = 0; try { Thread.sleep(component.getThrottlingTimeout()); } catch (InterruptedException e) { LOG.warn("throttling failed", e); } } intervalCount++; } }
if user specifies positive values (default value is 1) of throttlingInterval then "if" statement is always true. So user need to specify negative values of throttlingInterval in order to not force thread sleep on each doSend method. Also it would be good to add a little bit logging here. So I propose the following modification:
protected void throttle() { if (component.isExchangeThrottling()) { if (component.getThrottlingInterval() < intervalCount) { intervalCount = 0; try { long timeout = component.getThrottlingTimeout() LOG.debug("throttling, sleep for: "+timeout); Thread.sleep(timeout); } catch (InterruptedException e) { LOG.warn("throttling failed", e); } } intervalCount++; } }