Coder Social home page Coder Social logo

Comments (24)

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024 3

Closed via 6e0e636

from spring-cloud-openfeign.

roll57 avatar roll57 commented on June 15, 2024 1

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.

Hollerweger avatar Hollerweger commented on June 15, 2024 1

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.

zteater avatar zteater commented on June 15, 2024 1

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.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

That PR was never merged and the issue is still open.

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

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.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

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.

karlnicholas avatar karlnicholas commented on June 15, 2024

How does one get in touch with AdrianCole for contributing?

from spring-cloud-openfeign.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

Gitter is probably best

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

@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.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

What do you mean Netflix is a couple revisions back?

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

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.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

Are you referring to the Boot version?

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

I assume so but mostly I'm referring to the version numbers of the pom.xml's in question.

from spring-cloud-openfeign.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

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.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

Should be all set now

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

Okay, let me have a look.

from spring-cloud-openfeign.

Tcharl avatar Tcharl commented on June 15, 2024

Hi Guys,

What's new on this one? This is kind of a blocker for spring-cloud addicts...

from spring-cloud-openfeign.

ryanjbaxter avatar ryanjbaxter commented on June 15, 2024

It’s labeled as help wanted, so we are looking to the community to add support

from spring-cloud-openfeign.

karlnicholas avatar karlnicholas commented on June 15, 2024

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.

Tcharl avatar Tcharl commented on June 15, 2024

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.

Julyandyou avatar Julyandyou commented on June 15, 2024

Support Spring Data Pageable in Feign Client #556
According to @IsNull's operation, Still unable to run ....

from spring-cloud-openfeign.

morth avatar morth commented on June 15, 2024

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.

luizhenriquesantana avatar luizhenriquesantana commented on June 15, 2024

Just add this to your controller:

@Bean public Module pageJacksonModule() { return new PageJacksonModule(); }

from spring-cloud-openfeign.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.