springwolf-core icon indicating copy to clipboard operation
springwolf-core copied to clipboard

Support KafkaListener topicPattern

Open timonback opened this issue 1 year ago • 1 comments

Hey yall. I have this use case where we're using a pattern instead of the topic names:

@KafkaListener(topicPattern="")

However, I get an error during start up and no topics are included in the UI.

Am I missing something or is this a bug?

2024-05-01T19:39:16.842+02:00 ERROR 70862 --- [Springwolf example project - Kafka] [           main] i.g.s.c.a.o.DefaultOperationsService     : An error was encountered during operation scanning with io.github.springwolf.core.asyncapi.scanners.operations.SpringAnnotationOperationsScanner@30922f8d: Index 0 out of bounds for length 0

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0

Copied from Discord OP: @raphaeldelio

timonback avatar May 02 '24 17:05 timonback

I wonder, whether the exception is thrown here: https://github.com/springwolf/springwolf-core/blob/master/springwolf-plugins%2Fspringwolf-kafka-plugin%2Fsrc%2Fmain%2Fjava%2Fio%2Fgithub%2Fspringwolf%2Fplugins%2Fkafka%2Fasyncapi%2Fscanners%2Fcommon%2FKafkaListenerUtil.java#L33 since you use topicpattern and not topics

timonback avatar May 02 '24 17:05 timonback

The change is available in the latest release. 🎉

Thank you for the report/contribution and making Springwolf better!

github-actions[bot] avatar May 31 '24 16:05 github-actions[bot]