O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fallback

On the other hand, Istio does not have a fallback policy for when all the retries fail – it is not possible to have Istio call another version of your workload. When you annotate the preceding code with the @Fallback annotation, it is possible to execute another action in case the original call fails:

@Fallback(fallbackMethod = "fallbackForA")@Retry (maxRetries = 3)string aMethod() {   callBackend();}void String fallbackForA() {    return "A cached string";}

In this case, the fallbackForA fallback method will be called once all the retries from Istio, times those from MicroProfile, have been exhausted. If you remove the @Retry annotation from the preceding example, the fallback method is called when the Istio retries have been exhausted. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required