2

I have my Jhipster config/ApplicationProperties.java class setup and working however it's not clear how to inject a property value into the FeignClient annotation for the url:

@FeignClient(
  name="myApi",
  url="how do I inject an application.yml property here?",
  configuration="MyConfig.class")

Using @Value doesn't work per below:

@FeignClient(
  name="myApi",
  url=@Value("${application.api.url}"),
  configuration="MyConfig.class")

Any thoughts?

spasco
  • 43
  • 5

1 Answers1

1

You can do like this

@FeignClient(
  name="myApi",
  url="${application.api.url}",
  configuration="MyConfig.class")
Viraj Dhamal
  • 5,165
  • 10
  • 32
  • 41