This application is a Spring Boot microservice that serves as a Consumer for Book Service Application. It is designed to be discoverable and configurable using Spring Cloud.
| Key | Type | Description | Default Value |
|---|---|---|---|
| spring.application.name | String | The name of the application. In this case : book-rest-client. |
|
| eureka.instance.hostname | String | Sets the hostname for a Eureka instance. For example, to set the hostname to localhost in standalone mode |
|
| eureka.client.serviceUrl.defaultZone | String | To specify the default zone for the Eureka server. This property is used by Eureka clients to locate the Eureka server where they register themselves and discover other services |
- Retrieves all books.
- Saves a list of books.
- GET /api/books : Retrieves all Books.
- POST /api/books: Saves new Books. The request body should be in JSON format, for example, refer to sample.json.
To run this project locally, you need to have Java and Maven installed on your machine.
- Clone the repository
- Navigate to the project directory
- Update the client configuration like
server.portandeureka.client.serviceUrl.defaultZoneinapplication.propertiesfile. - Make sure the Eureka Server, Config Server and Book Service is up and Running.
- Run
mvn spring-boot:runto start the application - See if the Service is discoverable at the Eureka Server by accessing http://localhost:9000.
- Access the resource of this service at http://localhost:9001/api/books (
9001port as mentioned inapplication.properties)
- Spring Boot
- Spring Boot Web
- Spring Cloud Netflix Eureka Client
- Mayank Sahu (https://github.com/mayank19o7).