Saturday, 13 July 2019

Microservices (nodejS

Firstly, Hi. I have to decide between 2 patterns in design communication between microservices in nodeJS.I decide to make my own, microservice lib, which will feet to my project.My problem is:When microservice, receive request thought ( api ), I need to do some logic, and then to send a response back to the caller ( another microservice).What is on my mind is:Logic in this handler may have some hard computing, or maybe need to do some logick who will take a while. I came upon an idea to make executionQueue. which will take action from the handler, and pass this command to the queue. And handler will send the response, something like: the commend is successfully added to the queue. ( i am trying to not block the event loop, and to make communication more dynamic.In the background, I would have logic who will execute commands from executionQueue, and when i finish scheduled command ( service job, call/whatever ). I will send a request to the service who asked for a favor.The point at this design is to decrease the number of longRuning requests, and to have fast replay on request. Because service mayHave, 200 requests/5 sec, so I don't want to stuck eventLoop.Also, we will support the tcp/ip (socket) protocol, to communicate with service Registry and between services.What you think guys? I need some advice, options, suggestions, discussion ....Everything which can help me, to better design the microservice lib, for multiPurposes.Thank

Submitted July 13, 2019 at 03:10PM by Abukodonosor

No comments:

Post a Comment