0

I recently found that I can set the follow redirects as folase so that I can get to Location in the 302 response. But It goes to the fallBackFactory with exception feign.FeignException: [302 Found].

I read from another blog that if you want to stick with the 302 status code, you can change your Feign client definition to return a feign.Response

Can someone advise how do do this or any reference?

As mentioned I tried to set follow redirect as false it is still returning exception so I am struck how to overcome this

1 Answers1

0

I Found the answer very straight forward.

import feign.Response;

@RequestMapping(method = RequestMethod.GET, value = "endpoint", consumes = "application/json")
    Response apimethodname(@RequestParam String param1);

This way it does not go to FallBack and we have complete control to check the status.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77