Add retry and DLQ support for the Kafka binder

Fixes #498

- Honour the retry settings from ConsumerProperties;
- Add an additional  `enableDlq` option in KafkaConsumerProperties that enables forwarding failed messages to a DLQ topic.
This commit is contained in:
Marius Bogoevici
2016-04-28 14:32:17 -04:00
committed by Gary Russell
parent 4247fe42bd
commit fa42b62074
5 changed files with 311 additions and 71 deletions

View File

@@ -63,7 +63,17 @@ public abstract class AbstractBinderTests<B extends AbstractTestBinder<? extends
* waiting up to 1s (times the {@link #timeoutMultiplier}).
*/
protected Message<?> receive(PollableChannel channel) {
return channel.receive((int)(1000 * timeoutMultiplier));
return receive(channel, 1);
}
/**
* Attempt to receive a message on the given channel,
* waiting up to 1s * additionalMultiplier * {@link #timeoutMultiplier}).
*
* Allows accomodating tests which are slower than normal (e.g. retry).
*/
protected Message<?> receive(PollableChannel channel, int additionalMultiplier) {
return channel.receive((int)(1000 * timeoutMultiplier * additionalMultiplier));
}
@Test