I have a need to mix calls to a Spring Rest Template using either a Eureka-compliant service name (example-service-name) or a real url (http://my-url.com).
The Eureka-friendly URLs work fine, as Ribbon can look them up without issue. Obviously real URLs fail because they can't be found.
I'd like to be able to integrate Eureka-URLs over time, while maintaining the existing functionality for Spring property-driven direct URLs.
Can I
- Configure Ribbon to fall back to a default non-Eureka behavior in the event it fails to resolve a URL ?
or
- Spoof Eureka Name/URL pairs in my local Spring configuration and include them in Ribbon's Eureka url resolution ?
Edit: Real URLs are failing because the Ribbon client throws an exception if a Eureka lookup fails
Caused by: java.lang.IllegalStateException: No instances available for http://my-url.com
at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:75)