My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Feign + Eureka: UnknownHostException when Attempting to Invoke a Service





When attempting use Feign to invoke a service through Eureka, the following exception occurs:-

MY-HOST-NAME executing GET http://donkey-kong-service/throw/barrels/10
feign.RetryableException: MY-HOST-NAME executing GET http://donkey-kong-service/throw/barrels/10
	at feign.FeignException.errorExecuting(
	at feign.SynchronousMethodHandler.executeAndDecode(
Caused by: MY-HOST-NAME


Go to the donkey-kong-service app and add the following line to the


Now, when Feign tries to invoke the service, the IP address will be used instead of the OS’ reported hostname.


One response to “Feign + Eureka: UnknownHostException when Attempting to Invoke a Service”

  1. dsagy Avatar

    Feign is not able to resolve service name with IP address. E.g Feign trying to request http://registrationServices/api/registration-services/registrationId , where registrationServices is service registered with Eureka and name of Fiegn client .

    I have also set eureka.instance.preferIpAddress=true in registration services and its reflecting in Eureka , but somehow Fiegn is not able to resolve it.

Leave a Reply

%d bloggers like this: