M
M
mirexdoors2018-11-28 20:45:15
Design patterns
mirexdoors, 2018-11-28 20:45:15

How to properly design a request processing service?

Hello! I have very little experience in architecture development, so I will be glad to help =)
There is a service that accepts incoming requests from different sources, for example:

{
    id: 1,
    action: 4,
    message: "hello"
}

based on action-a, it generates an outgoing one and sends it to another service.
Incoming requests can be with a different structure. data. As well as outgoing.
According to my ideas, we need a separate class for parsing the incoming request, which will determine for each action you need to do, separate classes, by the methods of which an object with data will be prepared from the incoming request. Well, a class for sending outgoing requests, in which a request will be sent based on the same action and an object with prepared data.
Am I thinking right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question