A simple sample of microservice on spring-boot.
Ticket service provides endpoints to receive data related to events.
This microservice is connected with another microservice via service registry pattern. A key advantage of a microservices architecture is the ability to create new instances of each service to meet the current load, respond to failures and roll out upgrades. One side effect of this dynamic server-side environment is that IP address and port of a service instances change constantly. In order to route an API request to a particular service, the client or API gateway needs to find out the address of the service instance it should use. Whereas in the past it might have been feasible to record these locations in a config file, in a dynamic environment where instances are added and removed on the fly, an automated solution is needed. Service discovery provides a mechanism for keeping track of the available instances and distributing requests across them.
- Install Java 19 from https://www.oracle.com/java/technologies/downloads/
- Install Maven 3 from https://maven.apache.org/download.cgi
- Install PostgreSQL from https://www.postgresql.org/download/
- Clone this repository:
$ git clone https://github.com/eyakauleva/ticket-microservice.git
- Navigate to the project directory:
$ cd ticket-microservice
- Start the application:
$ mvn spring-boot:run
- App is ready to receive requests to
http://localhost:9090/