Creating Java Mature Microservice with JPA
Last updated: 2025-09-14
This section shows how to create a Mature REST Microservice API’s in no-time.
Steps:
-
Create Maven project such as the following:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-mature-microservice-tutorial.adoc - include::inc/mature-service/pom.xml[]
If you are using Eclipse, be sure to refresh your project (select your project→ right click→ Maven→ Update Project) |
-
Create Model class at src/main/java/com/app/person.Model.java, such as the following:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-mature-microservice-tutorial.adoc - include::inc/mature-service/src/main/java/com/app/person/Model.java[]
-
Create Service class as REST service at src/main/java/com/app/person/Service.java, such as the following:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-mature-microservice-tutorial.adoc - include::inc/mature-service/src/main/java/com/app/person/Service.java[]
-
Create App class at src/main/java/com/app/App.java for quick testing with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-mature-microservice-tutorial.adoc - include::inc/mature-service/src/main/java/com/app/App.java[]
Run your App class, you should see something like this in your console:

The available end-points are:
-
POST: http://localhost:8080/app/persons with Person JSON object with(national_id, name, email, address) fields in the body.
-
PUT: http://localhost:8080/app/persons/{id} with Person JSON object
To call the this Microservice from Java client, you can follow this - Create Mature Microservice Client
Full example source-code can be found at https://github.com/smartapi-com/j-framework-microservice-mature |