Skip to content

Feign & Pageable #1380

Open
Open
@alabotski

Description

@alabotski

Tell me how to properly configure the work of Feign and Spring Pageable Here are my Feign settings

feign:
  okhttp:
    enabled: true
  autoconfiguration:
    jackson:
      enabled: true
  client:
    config:
      default:
        connectTimeout: ${FEIGN_DEFAULT_CONNECT_TIMEOUT:10000}
        readTimeout: ${FEIGN_DEFAULT_READ_TIMEOUT:60000}
        loggerLevel: full
        errorDecoder: ru.core.config.TokenErrorDecoder
        retryer: ru.service.SudisTokenService

My FeignClient

@FeignClient(name = "BaseCaseFeignClient", url = "${feign.services.host-backend.url}")
public interface BaseCaseFeignClient {
    @GetMapping("/api/cases/base")
    Page<BaseCaseEntityDto> getBaseCases(@SpringQueryMap BaseCaseEntityFilter filter, Pageable pageable);

    @PostMapping("/api/cases/base/search")
    Page<FoundRecordDto> searchCases(@RequestBody FilterSpecification filter, @SpringQueryMap Pageable pageable);
}

Get request works fine. Problem with post request. I am getting the following error

"No property caseOpenDttm: DESC found for type BaseCaseEntity!"

And in this case, the project is not going to be assembled at all.

Page<FoundRecordDto> searchCases(@RequestBody FilterSpecification filter, Pageable pageable);

Caused by: java.lang.IllegalStateException: Method has too many Body parameters: public abstract org.springframework.data.domain.Page ru..BaseCaseFeignClient.searchCases(ru.ilter.shared.basecase.search.FilterSpecification,org.springframework.data.domain.Pageable)
Warnings:

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionGeneral usage or 'how-to' questionsspring-cloudIssues related to Spring Cloud OpenFeign

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions