Skip to content
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

how to add HttpMessageConverter in feignclient #57

Closed
newShiJ opened this issue Aug 16, 2018 · 4 comments
Closed

how to add HttpMessageConverter in feignclient #57

newShiJ opened this issue Aug 16, 2018 · 4 comments
Labels
question Further information is requested

Comments

@newShiJ
Copy link

newShiJ commented Aug 16, 2018

No description provided.

@ryanjbaxter
Copy link
Contributor

Declaring any additional HttpMessageConverter as a Bean should automatically be added to all Feign clients.

@ryanjbaxter ryanjbaxter added the question Further information is requested label Aug 16, 2018
@newShiJ
Copy link
Author

newShiJ commented Aug 17, 2018

thank you

@strongfist
Copy link

@newShiJ have your problem solved

my client is:
@PutMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
ResponseEntity uploadFile(URI uri, ByteArrayOutputStream outputStream );
except i have added ByteArrayHttpMessageConverter like Http Message Converters with the Spring Framework
and failing the same this converter does not take effect.

feign.codec.EncodeException: Could not write request: no suitable HttpMessageConverter found for request type [java.io.ByteArrayOutputStream]
at org.springframework.cloud.openfeign.support.SpringEncoder.encodeWithMessageConverter(SpringEncoder.java:188)
at org.springframework.cloud.openfeign.support.SpringEncoder.encode(SpringEncoder.java:134)
at org.springframework.cloud.openfeign.support.PageableSpringEncoder.encode(PageableSpringEncoder.java:101)
at feign.ReflectiveFeign$BuildEncodedTemplateFromArgs.resolve(ReflectiveFeign.java:396)
at feign.ReflectiveFeign$BuildTemplateByResolvingArgs.create(ReflectiveFeign.java:232)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:84)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
at jdk.proxy2/jdk.proxy2.$Proxy169.uploadFile(Unknown Source)

@waveofmymind
Copy link

Today, I also encountered a similar issue while using OpenFeign in a Webflux environment.
Has this issue been resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants