Skip to content

Controller method return type is properly set only for wrapper types #8

@Unstopabul

Description

@Unstopabul

If a KafkaListener method looks like this:
java.util.concurrent.CompletableFuture<ExampleOut>handleExampleIn(@Payload ExampleIn examplein, @Headers Map<String, String> headers);

the resulting controller method looks like this (returning type is ExampleOut which is correct):
public ExampleOut executeExampleIn(@RequestBody ExampleIn examplein,
@RequestParam @Parameter(hidden = true) Map<String, String> params,
HttpServletResponse servletResponse, @RequestHeader Map<String, String> headers) {
kafkaSenderService.send(topicName, examplein, params, servletResponse);
return new ExampleOut();
}

But if a KafkaListener method doesn't use wrappers for the returning type:
ExampleOuthandleExampleIn(@Payload ExampleIn examplein, @Headers Map<String, String> headers);

the resulting controller method return type will be void.

location: pro/axenix_innovation/axenapi/utils/ElementHelper.java -> method getReturnedTypeMirror (the method considers only types with typed arguments, for other types null is returned).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions