Route definition with the Ribbon client

There is another approach to configuring routes. We may disable Eureka discovery in order to rely solely on a list of network addresses provided with the listOfServers property of the Ribbon client. All incoming requests to the gateway are load balanced by default between all instances of the service through a Ribbon client. This rule is true even if you enable or disable service discovery, as in the following example code:

zuul: routes:  accounts:   path: /account/**   serviceId: account-serviceribbon: eureka:  enabled: falseaccount-service: ribbon:  listOfServers: http://localhost:8091,http://localhost:9091

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.