When using the HttpServiceRequest#bodyAs() to transform a request into the desired DTO object, I expected the operation to fail, the Future to fail, if the requested did not include the correct data. However when testing the behavior it seems like the call will create a Future that never ends when the data can not be read as the appropriate DTO. Is there a way to resolve this so that the future ends?
My initial thoughts were that the bodyAs() will throw a ClassCastException when input data could not be converted, but I could not test that.
Thanks for the feedback, the issue was related to a wrong use of the Future#await() inside the route handler, the service provided. The call to await() was blocking the thread that had to read the request.
Hello,
When using the HttpServiceRequest#bodyAs() to transform a request into the desired DTO object, I expected the operation to fail, the Future to fail, if the requested did not include the correct data. However when testing the behavior it seems like the call will create a Future that never ends when the data can not be read as the appropriate DTO. Is there a way to resolve this so that the future ends?
My initial thoughts were that the bodyAs() will throw a ClassCastException when input data could not be converted, but I could not test that.
Regards,