Receive concurrent http requests

Hi,
I'm trying to implement a microservices integrations with node-red, i have some custom nodes that makes http request to a microservices and functions nodes for message transformations and some subflows.

I builded a flow with all microservices integrated and i expose a URL for requests to flow using the http in node and http out for responses.

When i send two or more concurrent requests my flow sends the same response to all calls with the same message, like my flow only can process one request at time and doesn't log a different answer for each one, idk if i'm doing something wrong...

Node-Red supports process concurrent flows that come from "http in" node ?

Sorry, it was my mistake. I was using flow.get / flow.set in a bad way, I understood when I read the documentation that the information that is saved using flow.set / get lives in a "flow context" like a runtime context while the flow is running , but I was wrong, I reread it and realized my mistake.

When i sent concurrent requests, some executions were reading old values from vars stored in flow.get, so, now i'm using msg for save temporary variables in runtime context.

1 Like

It is a common pitfall for new users. Try to avoid context for flowing messages where possible. If you use content you should be prepared for concurrent changes.

Glad you're sorted.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.