You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ./gradlew build
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler output below.
/.../config/KafkaConfig.java:161: error: no suitable constructor found for DeadLetterPublishingRecoverer(Map<Class<?>,KafkaTemplate<?,?>>)
return new DeadLetterPublishingRecoverer(templates);
^
constructor DeadLetterPublishingRecoverer.DeadLetterPublishingRecoverer(KafkaOperations<? extends Object,? extends Object>) is not applicable
(argument mismatch; Map<Class<?>,KafkaTemplate<?,?>> cannot be converted to KafkaOperations<? extends Object,? extends Object>)
constructor DeadLetterPublishingRecoverer.DeadLetterPublishingRecoverer(Map<Class<?>,KafkaOperations<? extends Object,? extends Object>>) is not applicable
(argument mismatch; Map<Class<?>,KafkaTemplate<?,?>> cannot be converted to Map<Class<?>,KafkaOperations<? extends Object,? extends Object>>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to get full insights.
BUILD FAILED in 981ms
1 actionable task: 1 executed
Compile error occurs, because constructor accept KafkaOperations as parameter. So In the example code above, templates type should be Map<Class<?>, KafkaOperations<?, ?>> templates = new LinkedHashMap<>(); for now.
This should be ? extends KafkaOperations so that KafkaTemplate can be a parameter.
Uh oh!
There was an error while loading. Please reload this page.
Expected Behavior
This should be ok
Current Behavior
Compile error occurs, because constructor accept
KafkaOperations
as parameter. So In the example code above,templates
type should beMap<Class<?>, KafkaOperations<?, ?>> templates = new LinkedHashMap<>();
for now.This should be
? extends KafkaOperations
so that KafkaTemplate can be a parameter.Context
DeadLetterPublishingRecoverer
example to useKafkaOperations
#3911The text was updated successfully, but these errors were encountered: