Failover

You probably wish to ask what's going to happen if one instance of service discovery breaks down? In order to check how the cluster would behave in case of failure, we are going to modify the earlier sample a little. Now, Zuul has a failover connection to the second service discovery available on port 8762 set in its configuration settings. For testing purposes, we shut down the third instance of the discovery service available on port 8763:

eureka: client:   serviceUrl:     defaultZone: http://localhost:8763/eureka/,http://localhost:8762/eureka/   registerWithEureka: false

The current situation is illustrated in the following diagram. Testing is performed in the same way as earlier, by calling the gateway's endpoint available under the ...

Get Mastering Spring Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.