We want to control the rate at which a consumer can consume messages in HornetQ.
The problem is that when we use the ServerLocator.setConsumerMaxRate(int) method, we get always 1 message per second, regardless of the value we pass.
When we don’t call this method, the consuming rate is fast (much more than 1 per second).
Our code:
TransportConfiguration connectorConfig = new TransportConfiguration(InVMConnectorFactory.class.getName());
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(connectorConfig);
locator.setAckBatchSize(ackBatchSize);
locator.setConsumerWindowSize(CONSUMER_WINDOW_SIZE);
locator.setClientFailureCheckPeriod(Long.MAX_VALUE);
locator.setConnectionTTL(-1);
locator.setConsumerMaxRate(10);
The question is - how to control the consumption rate ? and why this setting does not affect the rate ?