-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WebClientException serializable #28321
Comments
Hi , I am a beginner and would like to work on this issue with some guidance if fine |
Even if we did make I am afraid that I see no other option than to map the |
Why not set non-serializable fields as transient? |
Because some implementations of the field are serializable, and some (Netty's) are not. I suppose we can make a copy of the |
Not all HttpHeaders implementations are serializable. This commit ensures that WebClientRequestException and WebClientResponseException are serializable, by copying any non-serializable HttpHeaders into a new, serializable, instance. Closes gh-28321
Affects: 5.3.17
We use asynchronous workflows with a workflow engine (Camunda) and call REST services using
WebClient
in those workflows. If a non-successful HTTP code is returned by the service, aWebClientException
is thrown. In this case, the workflow is suspended and the state including the exception is serialized to a database using standard Java serialization. This does not work forWebClientException
because the following exception is thrown:I created a minimal project (https://github.com/trettstadtnlb/netty-headers-not-serializable) that you can use to reproduce the problem by running
ExampleControllerTest
. The test makes a call to a REST endpoint that returns HTTP 422 and tries to serialize the exception that is thrown.The text was updated successfully, but these errors were encountered: