-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.1.0
Describe the bug
When adding a new delegate to a CommonDelegatingErrorHandler
, the check for compatibility with ackAfterHandle
and seeksAfterHandling
is not performed.
The following method does not check the delegatesToCheck
but uses the current this.delegates.values()
which does not yet contains the new delegates:
@SuppressWarnings("deprecation")
private void checkDelegatesAndUpdateClassifier(Map<Class<? extends Throwable>,
CommonErrorHandler> delegatesToCheck) {
boolean ackAfterHandle = this.defaultErrorHandler.isAckAfterHandle();
boolean seeksAfterHandling = this.defaultErrorHandler.seeksAfterHandling();
this.delegates.values().forEach(handler -> {
Assert.isTrue(ackAfterHandle == handler.isAckAfterHandle(),
"All delegates must return the same value when calling 'isAckAfterHandle()'");
Assert.isTrue(seeksAfterHandling == handler.seeksAfterHandling(),
"All delegates must return the same value when calling 'seeksAfterHandling()'");
});
updateClassifier(delegatesToCheck);
}
To Reproduce
Create a CommonDelegatingErrorHandler
and add an incompatible CommonErrorHandler
, no exception will be thrown.
Expected behavior
The new delegates compatibility should be validated.