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
While using the apicurio-codegen with the reactive flag enabled, I have noticed that if an OpenAPI operation returns a 204 No Content as HTTP response code, the generator will generate a resource method returning just void.
Let's take the following operation as an example ...
Thinking about using this together with Quarkus RESTeasy Reactive, it sounds to me that if the method starts an async operation, the Quarkus framework responds to the HTTP client immediately with a 204 even if the async operation is not finished yet. At least this is my understanding.
Isn't it better to have apicurio-codegen generating methods returning CompletionStage<Void> in such a case?
This way, if an async operation starts, it has to complete the future before Quarkus can return the response to the HTTP client.
In our specific case, for example, the subscribe operation could take some time because it involves a Kafka consumer client to subscribe to topics in Kafka and it could even return an error.
Wdyt?
The text was updated successfully, but these errors were encountered:
This seems reasonable to me, and I wouldn't limit it to just void methods probably. If the Quarkus extension detects Resteasy Reactive, all of the return types would be CompletionStage<T> rather than T.
While using the apicurio-codegen with the
reactive
flag enabled, I have noticed that if an OpenAPI operation returns a204 No Content
as HTTP response code, the generator will generate a resource method returning justvoid
.Let's take the following operation as an example ...
https://github.com/strimzi/strimzi-kafka-bridge/blob/main/src/main/resources/openapi.json#L287
apicurio-codegen will generate a method like this ...
Thinking about using this together with Quarkus RESTeasy Reactive, it sounds to me that if the method starts an async operation, the Quarkus framework responds to the HTTP client immediately with a
204
even if the async operation is not finished yet. At least this is my understanding.Isn't it better to have apicurio-codegen generating methods returning
CompletionStage<Void>
in such a case?This way, if an async operation starts, it has to complete the future before Quarkus can return the response to the HTTP client.
In our specific case, for example, the subscribe operation could take some time because it involves a Kafka consumer client to subscribe to topics in Kafka and it could even return an error.
Wdyt?
The text was updated successfully, but these errors were encountered: