Skip to content

Two JHipster microservices that can HTTP communicate as simple as calling methods.

License

Notifications You must be signed in to change notification settings

ramnaq/jhipster-ms-communication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JHipster microservices communication

This is a demonstration of how we can use Spring Cloud OpenFeign to implement communication between JHipster microservices. In other words, it shows how to make a microservice call other with few code and provides an abstraction for HTTP requests. After a few steps, calling a microservice from other is as easy as calling a method.

Components

In this repo you find two microservices client and server, where client calls server when a request is sent to it at /client/serverHello, with a request parameter name. Both microservices were generated with the official JHipster application generation tool, available here.

In each microservice directory there is a README automatically generated, containing more information about the JHipster application. That might help when running, testing, debugging and troubleshooting.

Running

In two different terminals, in the root of each microservice, run sh gradlew. After this you should have client and server running respectively on ports 8010 and 8020.

Now simply perform a GET request to /client/serverHello passing a name parameter.

[client] $ curl http://localhost:8010/client/serverHello?name=Salazar

The response should be: What's up, Salazar! Server speaking.

About

Two JHipster microservices that can HTTP communicate as simple as calling methods.

Topics

Resources

License

Stars

Watchers

Forks