DEV Community

Cover image for How to Quickly Setup Java Microservice Projects?
msmittalas
msmittalas

Posted on

How to Quickly Setup Java Microservice Projects?

When We start Development, Team often spends a significant amount of time in project setup work and developing mechanisms to handle cross-cutting concerns.

Cross cutting concerns like

  1. Externalized configuration - includes credentials, and network locations of external services such as databases and message brokers
  2. Logging - configuring of a logging framework such as log4j or logback
  3. Health check - a url that a monitoring service can β€œping” to determine the health of the application
  4. Security - for example, REST APIs must be secured by requiring an Access Token

It is typical to dedicate one to two days, occasionally even more, to setup the project and putting cross-cutting concerns as the initial investment is negligible if you plan to spend months or years developing a monolithic application.

However, if you are creating an application using a microservice architecture, the scenario is entirely different. Tens or even hundreds of services are available. You'll regularly design new services, and it will only take a few days or weeks to complete each one. You can't afford to take several days to set up each service.

Question: How to Quickly Setup Microservice Projects?

Answer:
*Microservice chassis pattern
*

Create a microservice chassis framework that can be foundation for developing your microservices.
The chassis implements Reusable build logic that builds and tests a service. This includes, for example, Gradle Plugins.
Mechanisms that handle cross-cutting concerns. The chassis typically assembles and configures a collection of frameworks and libraries that implement this functionality.

There are well developed Java microservice chassis available to use like Spring Boot, Spring Cloud and Drop Wizard.

The fundamental advantage of a microservice chassis is that updating dependencies, build logic, and cross-cutting concern logic is quicker and simpler. You only update each service to use the latest version of the microservice chassis framework, which has been updated to include the necessary changes.

One issue is that each programming language or framework you want to use has its own microservice chassis. Adopting a new programming language or framework may be difficult because of this.

Top comments (0)