-
Notifications
You must be signed in to change notification settings - Fork 693
Description
Description
Making Rest call using the Java Client results in a ZeebeFuture
containing the specific response for this request. This is the same way we worked with gRPC.
This becomes interesting when the Rest API returns an empty response (204). The body returned by the request will be null
. As a result we complete the future, with a null
value in it.
This is dirty from a user perspective. If I call a method using the client it states I will receive a ZeebeFuture
with a response object. As a user I would expect that joining this future on successful request would yield me this response object. Now it results in null
.
If the request wasn't successful it should yield an exception, which is what already happens now 👍
Proposal
We should always add a response object to the ZeebeFuture
in the java client.
I think there's 2 options:
- We do something clever in the java client to always instantiate a response object if the response body is
null
. - We don't return No Content (204) responses from the Rest API at all. In cases where we don't need to specify anything in the resposne it could be an empty object.