tzatziki
tzatziki copied to clipboard
Add the support of KafkaListeners
For the moment, i'm using the same method for for the main and retry topic
if i run a somple kafka test like below :
i'm having this error :
org.awaitility.core.ConditionTimeoutException: Condition with com.decathlon.tzatziki.kafka.KafkaInterceptor was not fulfilled within 10 seconds.
After debugging, i found that the issue came from this code bloc from the KafkaInterceptor class (which is not executed):
Actually, it's normal. As this annotation checks only the KafkaListener annotation and by declaring multiple ones on the same method -> a KafkaListeners annotation will be added (after compilation) to englobe them
for example :
public @interface Foos {
Foo[] value();
}
// pre Java 8
@Foos({@Foo(bar="one"), @Foo(bar="two")})
public void haha() {}
// post Java 8 with @Repeatable(Foos.class) on @Foo
@Foo(bar="one") @Foo(bar="two")
public void haha() {}
source : https://stackoverflow.com/questions/1554112/multiple-annotations-of-the-same-type-on-one-element To resolve the issue, we have to add an aspect to intercept the KafkaListeners calls also
Hello ! I can see the issue. As a workaround maybe you can create two methods which call the same private method in the end ? (watch out for @transactional which should be duplicate on both entry method to work since it doesn't work when calling private method).
If it is really annoying feel free to contribute :)
Yes, For the moment, that's what i will do and thanks for the hint (i totally forget get, it's the same bean) Ok, i will create the Pull Request
Hi @mamdouni should we still implement this?