Comments (24)
Closed via 6e0e636
from spring-cloud-openfeign.
Using a plain Pageable
for POST request with a body will not work.
I guess it is still required in that case to apply a workaround with a custom annotation and having a bean extending AnnotatedParameterProcessor
from spring-cloud-openfeign.
I still see an issue here. The PageJacksonModule Bean that is registered in org.springframework.cloud.openfeign.FeignClientsConfiguration
is not registered as a Module in ObjectMapper and missing when it tries to map Page and therefore fails.
When i try to register the Bean again then it fails because the Bean is already registered by FeignClientsConfiguration.
@Bean public Module pageJacksonModule() { return new PageJacksonModule(); }
Registering the PageJacksonModule in the objecMapper within a Controller solved the issue for me:
@Autowired
private ObjectMapper objectMapper;
@PostConstruct
public void addObjectMapperModules() {
objectMapper.registerModule(new PageJacksonModule());
}
from spring-cloud-openfeign.
PageJacksonModule
was not enough to get this working for me. I was seeing this error:
Caused by: org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class org.springframework.data.domain.Sort]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.springframework.data.domain.Sort` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
Registering Sort with Jackson resolved it though:
@Autowired
private ObjectMapper objectMapper;
@PostConstruct
public void addObjectMapperModules() {
objectMapper.registerModule(new PageJacksonModule());
objectMapper.registerModule(new SortJacksonModule());
}
from spring-cloud-openfeign.
That PR was never merged and the issue is still open.
from spring-cloud-openfeign.
Hmm. Well, are people not using Feign generally? I'm thinking it's good for having ribbon included but maybe the better practice is to use zuul and RestTemplates and not use Feign?
from spring-cloud-openfeign.
There are people who are using Feign, and we are still actively maintaining Feign as part of Spring Cloud. However activity in the OpenFeign project has dropped and they are looking for contributors.
from spring-cloud-openfeign.
How does one get in touch with AdrianCole for contributing?
from spring-cloud-openfeign.
Gitter is probably best
from spring-cloud-openfeign.
@ryanjbaxter okay. Thanks. I started a gitter account but haven't tried to reach out yet. I worked on building current state of Netflix/feign/spring-cloud-openfeign but it seems the Netflix is a couple revisions back (2.0.0 instead of 2.0.2) and think it's best to wait a bit before looking at this again.
from spring-cloud-openfeign.
What do you mean Netflix is a couple revisions back?
from spring-cloud-openfeign.
Yea, the spring-cloud-netflix pom refers to the spring-cloud-build pom as the parent pom but refers to version 2.0.0-BUILD-SNAPSHOT. However the spring-cloud-build pom is on 2.0.2-BUILD-SNAPSHOT. It's the same for the spring-cloud-openfeign pom. I loaded and built the spring-cloud-build locally and updated the Netflix and Openfeign though I was a little concerned about submitting a patch to update the pom when I don't know what else might need to be done to bring the projects up to date. For example, the latest version for an application I was working on was 2.0.1.RELEASE and I could not go to 2.0.2.RELEASE because the Finchley.RC1 dependency needs 2.0.1.RELEASE. So at this point getting everything built locally so I could work on adding Pageable support to the openfeign project was getting a little daunting especially considering that the Netflix unit tests didn't pass right away on my windows machine. I had windows unit test issues for the feign (not openfeign) project but submitted a patch last weekend which they accepted. I wasn't worried so much about figuring out how to develop the Netflix stuff on a windows platform as much as the whole 2.0.0/2.0.1/2.0.2/Finchley.RC1 version resolution and figured maybe looking at Pageable support for Openfeign can wait until things settle down a little bit.
from spring-cloud-openfeign.
Are you referring to the Boot version?
from spring-cloud-openfeign.
I assume so but mostly I'm referring to the version numbers of the pom.xml's in question.
from spring-cloud-openfeign.
Oh I see what you are saying, spring-cloud-netflix and openfeign are still using spring-cloud-build 2.0.0.BUILD-SNAPSHOT. I will get that changes today, although it shouldn't make a huge difference.
from spring-cloud-openfeign.
Should be all set now
from spring-cloud-openfeign.
Okay, let me have a look.
from spring-cloud-openfeign.
Hi Guys,
What's new on this one? This is kind of a blocker for spring-cloud addicts...
from spring-cloud-openfeign.
It’s labeled as help wanted, so we are looking to the community to add support
from spring-cloud-openfeign.
Nothing new here. I put it on the back burner and rewrote everything in RestTemplate. RestTemplate seems to have more implicit Pivotal support since Feign is a Netflix project.
from spring-cloud-openfeign.
But Feign as better support when using eureka/netflix/ribbon than RestTempl: using resttemplate when dealing with multiple service instance is a pain with plain old mvc.
Also, the solution evoked in spring-cloud/spring-cloud-netflix#556 by @IsNull seems to work out of the box. It look simple to integrate as there's a PR associated.
from spring-cloud-openfeign.
Support Spring Data Pageable in Feign Client #556
According to @IsNull's operation, Still unable to run ....
from spring-cloud-openfeign.
For people that are having difficulties to get this working after upgrading to Greenwich.SR1:
Query encoding won't work when you annotate your Pageable
with @RequestParam
as supposed in spring-cloud/spring-cloud-netflix#556 in your Feign client - you'll have to use a plain Pageable
as you do in your controller method.
from spring-cloud-openfeign.
Just add this to your controller:
@Bean public Module pageJacksonModule() { return new PageJacksonModule(); }
from spring-cloud-openfeign.
Related Issues (20)
- Default request header headers overwriten with specific client configuration and shared by all clients HOT 1
- PlaytikaOSS feign-reactive does not support spring boot 3.2.x HOT 1
- MicrometerObservationCapability does not add metadata to prometheus metrics HOT 3
- Deserialization exception in native image with DTO with @ConstructorProperties HOT 6
- How can I set default protocol as https instead of Http using feign client with eureka? HOT 1
- Document maintenance mode and recommended migrations HOT 2
- For my openFeign implementation, noticing response decoding is taking too long HOT 3
- NPE in FeignResponseAdapter in case Content-Length header is not provided and response status is not 1XX, NO_CONTENT and NOT_MODIFIED HOT 2
- org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.cloud.loadbalancer.annotation.LoadBalancerClientConfiguration] HOT 4
- SslBundle integration with FeignClients HOT 2
- Error calling through feign: BeanDefinitionStoreException HOT 3
- Rest Controller doesn't return exception handler response but instead hangs forever and then returns feign exception unavailable response HOT 2
- SpringQueryMap doesn't serialize java.util.Date correctly while it present as object field HOT 1
- Spring version upgrade broke FeignClient loadbalancing HOT 3
- Headers annotation not sending headers HOT 2
- Upgrade to fileupload2 HOT 6
- IllegalArgumentException due to null servletRequest for Oauth2AccessTokenInterceptor after Spring Cloud Update HOT 3
- Fallback functionality should be selectively enabled depending on the actual presense of fallback implementation HOT 1
- provide ignore annotation to programmatically ignore method parameter HOT 1
- Support customization of JDK 11+ HttpClient
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-openfeign.