arrowhead-f / arrowhead-kalix

The Arrowhead Kalix Libraries
https://arkalix.se
Eclipse Public License 2.0
2 stars 5 forks source link

Never ending Future when use await() inside a route handler #19

Closed jaivgar closed 4 years ago

jaivgar commented 4 years ago

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,

jaivgar commented 4 years ago

Hello,

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.