Creating Simple Java Microservice Client

Last updated: 2025-09-14

Pre-Requisites:

  1. Create Simple Microservice

  2. Run the Microservice

This section shows how to create a simple REST Microservice service client in no-time.

Steps:

  1. Create Maven project with pom.xml such as the following:

Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-simple-microservice-client-tutorial.adoc - include::inc/simple-service-client/pom.xml[]

If you are using Eclipse, be sure to refresh your project (select your project→ right click→ Maven→ Update Project)

  1. Create Person class as a model class at src/main/java/com/app/Person.java, such as the following:

Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-simple-microservice-client-tutorial.adoc - include::inc/simple-service-client/src/main/java/com/app/Person.java[]
  1. Create App class at src/main/java/com/app.App.java for quick testing:

Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-service/java-simple-microservice-client-tutorial.adoc - include::inc/simple-service-client/src/main/java/com/app/App.java[]

Run your App class, you should see something like this in your console:

client

Full example source-code can be found at https://github.com/smartapi-com/j-framework-microservice-client