protected long beforePoll(long timeout) {
if (consumer instanceof PollingConsumerPollingStrategy) {
PollingConsumerPollingStrategy strategy = (PollingConsumerPollingStrategy) consumer;
try {
timeout = strategy.beforePoll(timeout);
} catch (Exception e) {
LOG.debug("Error occurred before polling " + consumer + ". This exception will be ignored.", e);
}
}
return timeout;