Skip to content

Latest commit

 

History

History
86 lines (52 loc) · 2.52 KB

README.md

File metadata and controls

86 lines (52 loc) · 2.52 KB

nodejs-micro-services

This is a app (conference-app) sample to microservices with NodeJS.

Here receive the requests and call the services regitered.

Service Registry

Project: service-registry

To register: PUT|DELETE /register/:servicename/:serviceversion/:serviceport

To use service: GET /find/:servicename/:serviceversion

Return service data:

{
    "timestamp": 1552334467,
    "ip": "[::1]",
    "port": "3009",
    "name": "service-1",
    "version": "1.2.0",
}

or

{
    "result": "Service not found"
}

The service expire.

Version

Service Version Control

Load Balancing

Service Version Control

Microservices

Project: feedback-service

Project: speakers-service

Services Server on listening

PUT <SERVICE-REGISTRY-HOST>/register/${config.name}/${config.version}/${server.address().port}

Services on ERROR/SIGN TERM/BY INTERVAL/ETC

DELETE <SERVICE-REGISTRY-HOST>/register/${config.name}/${config.version}/${server.address().port}

Tolerance and Resilience

  • Closed State

Closed State

  • Circuit Break Control

Circuit Break

  • Cache and Cache Images (key = requestMethod + requestURL)

  • SpeakersService

Queues

This example use the RabbitMQ

  • Install server: brew install rabbitmq
  • Install client: npm i ampqlib

Queuing

Consuming and Store