1

So the architecture I am currently working with, we have an api-gateway that gets all the requests and publishes them to our Eventsystem/ or directly to our essential services(auth, etc). Now we want to add a Socketbased Microservice that consumes some of our topics and processes them for client consumption.

But the question is, is there a proper way to forward the socket.io request through our gateway ?

The gateway is written in Node and the microservice probably too (but other recommendations are welcome, if there is a language that might be better suited for this usecase).

The current approach is to just use a proxy:

const options = {
    target: 'http://127.0.0.1:1234/test',
    changeOrigin: true,
    secure: false,
    ws: true
};

const socketProxy = proxy(options);
app.use('/reports', socketProxy );

But this way all our logging, healthchecks, req montiring would have to be implemented anew by the new service.

Is there a better way to approach this desgin ?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.