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
The class FeignException implements Serializable inherited from the Exception hierarchy, however, it contains the object feign.Request which is not Serializable itself, therefore further serialization into either JSON or Camunda process variable is impossible (my case), etc...
Is possible to either change the internals of feign.Request to be serializable itself or amend FeignException to hold information about the failed request in another way?
I think we would ok with either option. The simplest would be to investigate what it would take to make RequestSerializable. Would you be willing to look into that for us?
I have already looked into the internals of feign.Request (and its feign.template.Template) which use objects right from JDK such as java.nio.charset.Charset that is not Serializable itself...
I think there are two ways:
Make Request as transient in the FeignException.
Make Request implement Serializable and all instance field classes Serializable/transient.
The object can never be fully Serializable when it uses java.nio.charset.Charset as an instance field internally.
Edit: I can make a pull-request, but I'd like to discuss the best way to go first.
I think it's reasonable enough for us to change the charset instance variable type, so long as the method interfaces don't change. Are there any other instance variables that pose a problem?
I have noticed no more problematic classes aside from java.nio.charset.Charset. We can substitute it with either a String literal or an enumeration from which we would be able to construct Charset where needed and keeping the interfaces untouched. If I propose a pull request, would you check it up?
Activity
kdavisk6 commentedon Mar 29, 2020
@nikolas-charalambidis
I think we would ok with either option. The simplest would be to investigate what it would take to make
RequestSerializable. Would you be willing to look into that for us?nikolas-charalambidis commentedon Mar 30, 2020
I have already looked into the internals of
feign.Request(and itsfeign.template.Template) which use objects right from JDK such asjava.nio.charset.Charsetthat is notSerializableitself...I think there are two ways:
Requestastransientin theFeignException.RequestimplementSerializableand all instance field classesSerializable/transient.The object can never be fully
Serializablewhen it usesjava.nio.charset.Charsetas an instance field internally.Edit: I can make a pull-request, but I'd like to discuss the best way to go first.
kdavisk6 commentedon Apr 6, 2020
@nikolas-charalambidis
I think it's reasonable enough for us to change the charset instance variable type, so long as the method interfaces don't change. Are there any other instance variables that pose a problem?
nikolas-charalambidis commentedon Apr 11, 2020
@kdavisk6
I have noticed no more problematic classes aside from
java.nio.charset.Charset. We can substitute it with either a String literal or an enumeration from which we would be able to constructCharsetwhere needed and keeping the interfaces untouched. If I propose a pull request, would you check it up?Serializable feign.Request #1193 (#1262)
kdavisk6 commentedon Dec 29, 2020
Closed via #1262
Serializable feign.Request #1193 (#1262)
Serializable feign.Request #1193 (#1262)