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

feign.RetryableException: Invalid HTTP method: PATCH executing PATCH #2119

Open
edersonlcaldatto opened this issue Feb 14, 2024 · 2 comments

Comments

@edersonlcaldatto
Copy link

edersonlcaldatto commented Feb 14, 2024

Resilience4j version: 2.1.0

Java version: 17

When a use resilience4jFeign in my project that haves a PATCH endpoint, i get error .

feign.RetryableException: Invalid HTTP method: PATCH executing PATCH http://localhost:8080/maintenances/teste/123

`
@configuration
public class CustomerDataConfig {

@Value("${client.customer-data.url}")
private String customerDataUrl;

@Bean
public CustomerDataClient getCustomerDataClient() {
    FeignDecorators decorators = FeignDecorators
            .builder()
            .withFallbackFactory(CustomerDataClientFallback::new)
            .build();

    return Resilience4jFeign
            .builder(decorators)
            .requestInterceptor(new CustomerDataInterceptor())
            .client(new OkHttpClient())
            .contract(new SpringMvcContract())
            .encoder(new JacksonEncoder())
            .decoder(new JacksonDecoder())
            .logLevel(Logger.Level.FULL)
            .logger(new Slf4jLogger())
            .retryer(Retryer.NEVER_RETRY)
            .options(new Request.Options(
                    30, TimeUnit.SECONDS,
                    30, TimeUnit.SECONDS, false))
            .target(CustomerDataClient.class, customerDataUrl);
}

}

`

I have tried to change client, without sucess

here dependencies for the project

`
// Resilience4j /feing
implementation("io.github.resilience4j:resilience4j-spring-boot3:${resilience4jVersion}")
implementation "io.github.resilience4j:resilience4j-retry:${resilience4jVersion}"
implementation "io.github.resilience4j:resilience4j-feign:${resilience4jVersion}"
implementation("io.github.resilience4j:resilience4j-all") // Optional, only required when you want to use the Decorators class

implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'io.github.openfeign:feign-httpclient:13.1'
implementation 'io.github.openfeign:feign-okhttp:12.4'
implementation 'io.github.openfeign:feign-jackson:12.5'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.0'

`

Using the convetional whay it works

`
@FeignClient(name = "teste", url = "http://localhost:8080")
public interface LocalTeste {

@PatchMapping("/teste/{id}")
String teste(
        @PathVariable("id") String id,
        @RequestBody String json);

}
`

@RobWin
Copy link
Member

RobWin commented Feb 14, 2024

Do you have the full stacktrace?

@edersonlcaldatto
Copy link
Author

I don`t have anymore.

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

No branches or pull requests

2 participants