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
If we create the implementation like below, the API won't generate the controller because it doesn't see the interface annotations (@KafkaHandler etc.):
@KafkaListener(topics = "example_topic", groupId = "example_group") public class ExampleKafkaListener implements ExampleTopicExampleGroupListener { @Override public CompletableFuture<ExampleOut> handleExampleIn(ExampleIn examplein, Map<String, String> headers) { return null; } }
So we have to repeat all annotations (method-level and parameter-level) for the API to start working:
For example we have this generated listener interface:
//@KafkaListener(topics = "example_topic", groupId = "example_group")
public interface ExampleTopicExampleGroupListener {
@KafkaHandler
@KafkaHandlerDescription("example handler")
@KafkaHandlerTags(tags = { "example" })
@KafkaHandlerHeaders(headers = {
})
java.util.concurrent.CompletableFuture<ExampleOut> handleExampleIn(@Payload ExampleIn examplein, @Headers Map<String, String> headers);
}
If we create the implementation like below, the API won't generate the controller because it doesn't see the interface annotations (
@KafkaHandler
etc.):@KafkaListener(topics = "example_topic", groupId = "example_group")
public class ExampleKafkaListener implements ExampleTopicExampleGroupListener {
@Override
public CompletableFuture<ExampleOut> handleExampleIn(ExampleIn examplein, Map<String, String> headers) {
return null;
}
}
So we have to repeat all annotations (method-level and parameter-level) for the API to start working:
@KafkaListener(topics = "example_topic", groupId = "example_group")
public class ExampleKafkaListener implements ExampleTopicExampleGroupListener {
@Override
@KafkaHandler
@KafkaHandlerDescription("example handler")
@KafkaHandlerTags(tags = { "example" })
@KafkaHandlerHeaders(headers = {
})
public CompletableFuture<ExampleOut> handleExampleIn(
@Payload
ExampleIn examplein,
@Headers
Map<String, String> headers) {
return null;
}
}
location: pro/axenix_innovation/axenapi/processor/KafkaControllerProcessor.java -> method process -> <comment /* Find all methods with KafkaHandler annotation. Get DTO argument */> -> line:
List<? extends AnnotationMirror> list = this.processingEnv.getElementUtils().getAllAnnotationMirrors(element);
The text was updated successfully, but these errors were encountered: