Problem with Feign Client

Asked

Viewed 272 times

1

Good afternoon I have a small problem connecting to another API with the feign client, what happens that testing locally works, when I go to production that it simply gives a notfound.

Code of Feign Client Service

@FeignClient("service-buscar-indice")

public interface BuscarIndiceFinanceiroService {
public static final String HTTP_HEADER_AUTHORIZATION= "Authorization";
static final String HTTP_HEADER_APPLICATION = "Application";

@GetMapping(value = "", consumes = MediaType.APPLICATION_JSON_VALUE)
public String buscarIndice(
        @RequestHeader(name = HTTP_HEADER_AUTHORIZATION) String authorizationHeaderValue,
        @RequestHeader(name = HTTP_HEADER_APPLICATION) String application,
        @RequestParam(name = "codigo", required = true) String codigo);

}

Controller code of the other api (yes the feign is already enabled and etc... locally works, that’s the problem kk)

@RestController
@RequestMapping(path = "")
public class BuscarIndiceController {

@Autowired
private BuscarIndiceService buscarIndiceService;

@GetMapping(path="")
public String buscarIndiceFinanceiro(@RequestParam(name="codigo",required=true) String codigo){
    return buscarIndiceService.buscarIndicePorCodigo(codigo);
}


}

1 answer

0

@Feignclient does not yet support @Getmapping annotations, @Postmapping, @Updatemapping and @Deletemapping, use @Requestmapping instead of @Getmapping.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.