Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

Some of the SOAJS Gateway features are:

  • handle the awareness among the micro-services
  • monitor the health of all the registered services
  • redirecting the requests into the appropriate services
  • decrypt cookies from logged in members requests

In the previous examples, a request to a particular service must be sent to the port that that service is listening to.

However, the controller alleviates this issue. Instead of worrying about ensuring the correctness of the service port number,

it is sufficient to direct the request to the controller's port number, while specifying the name of the service and the API being called.

Service Exploration

...

To turn on the gateway in a development environment you just need to start the environment as follow 

...

Code Block
languagebash
titleController Heartbeat
linenumberstrue
# Direct request to the example01 service
CURL -X GET "http://127.0.0.1:4021/testGet?firstName=John&lastName=Doe"
# Indirect request to the example01 service through the controller
CURL -X GET "http://127.0.0.1:20000/example01/testGet?firstName=John&lastName=Doe"

Both commands invoke the same API of the same service. However, the controller alleviates the problem of memorizing the port number of each service.

Evidently, the controller has much more important and delicate tasks than solely redirecting calls to their appropriate services.

For further information, the Controller Gateway section provides detailed explanation about this service and its tasks.