Projects that provide examples on creating microservices, registering with eureka server, use eureka service discovery to talk to each other. Also has examples on using Hystrix for adding fall back methods, GemFire for caching, Swagger for REST end point documentation.
Refer to the Wiki page for more detailed information https://github.com/agundavaram/spring-boot-eureka-hystrix-example/wiki
This example contains the examples on the following
- creating/configuring Eureka server
- creating a microservice and registering it with Eureka server
- microservices interacting with each other using eureka discovery
- making synchronous/asynchronous(both AsyncRestTemplate and @Async) between microservices
- adding custom executors, custom exception handlers, callback methods for asynchronous calls
- adding caching capability using GemFire
- adding fall back method using Hystrix
- adding REST API documentation using Swagger
The above are all illustrated through simple end points in the AuthorController. The an overarching theme for this example is to have author microservice talk to book-service and award-service to retrieve information needed to display the author information. The REST end points exposed in the AuthorController are the entry points for all the examples.
To keep the examples simple and focused, JPA/DB layer is not introduced. The service end points return static data mimicing interactions with a datasource.
Projects
-
eureka-server This is the eureka-server Starts on the default port of eureka-server, 8761 All other microservices register to this server
-
award-service This is the the microservice to retrieve information about awards
-
book-service This is the microservice to retrieve information about books.
-
author-service This is the microservice to retrieve information about authors. The AuthorController has the entry points for the all examples mentioned above