Skip to main content
Version: 2.x

Services

The springboot microservices are developed and maintained inside the the services folder. Each microservice SHOULD be its own independent project folder in services.

This is an example of the services folder structure:

Services

In the data-viz-example project we have some microservices

services
├── api-common
│ ├── commons
│ ├── registry
│ ├── zuul
├── amp-funding
├── cashew-pricing
├── example-service
├── files
├── starter

The amp-funding, cashew-pricing, example-service, files, starter are basic microservices that are project specific that power data-viz-example project. The base microservices are in api-common which are shared project to all data-viz-api projects.microservices

api-commons​

Its base project which is MANDATORY in included in gitmodules as data-viz-api which comes with several main services which act as the base project for the microservices.

commons​

This contains the base controllers, tables e.t.c which are shared and used by other microservices.

registry​

We use netflix eureka as our service registry. All our microservices are discovered by eureka by adding

eureka.client.serviceUrl.defaultZone=http://eureka:8761/eureka/

in properties file in each microservice that you want to register in eureka.

To make sure that the running microservices are registerd in eureka, navigate to this url after running the services http://localhost:8761/ you will see all the services instances registered.

gateway​

This service we use it for authentication, jwt token handling and security. It also acts as our api gateway, we use gateway to communicate with registered eureka registry services and distribute traffic using load balancer to the correct microservice.