spring-guides / getting-started-guides

Getting Started Guide template :: The template for new guides and also the place to request them.
https://github.com/spring-guides/getting-started-guides/wiki
Apache License 2.0
522 stars 205 forks source link

GSG for Spring Cloud Netflix Ribbon #26

Closed fifthposition closed 8 years ago

fifthposition commented 8 years ago

Note that this doesn’t use @Configuration on the configuration class used for the Ribbon client, as that class is picked up by being in the same package as the @SpringBootApplication application class. From the Spring Cloud Netflix docs for Ribbon:

The FooConfiguration [class used for Ribbon client configuration] has to be @Configuration but take care that it is not in a @ComponentScan for the main application context, otherwise it will be shared by all the @RibbonClients. If you use @ComponentScan (or @SpringBootApplication) you need to take steps to avoid it being included (for instance put it in a separate, non-overlapping package, or specify the packages to scan explicitly in the @ComponentScan).

Should I elaborate on this (or add a note on it, or something)?

gregturn commented 8 years ago

I would put a note that essentially says what you have as a note right here.

gregturn commented 8 years ago

The section where you show how to run multiple copies, I would use the same tactic for supplying SERVER_PORT, since it works for both gradle and maven:

$ SERVER_PORT=9092 ./gradlew bootRun
...and...
$ SERVER_PORT=9092mvn spring-boot:run

It's just a little less overhead for the developer, since they can see it's the same thing.

gregturn commented 8 years ago

Apart from that, it looks great.

fifthposition commented 8 years ago

Both done. :smiley: Thank you!

gregturn commented 8 years ago

Resolved via https://github.com/spring-guides/gs-client-side-load-balancing/commit/198b13415a02c45160aada429df1ae5231639c10