How to enable parallel message processing in nodejs app? #427
-
SummarySo I have a Can anyone help me with how I can I implement this? ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
@utkarshdeep I'm coming exactly with the same dilemma. The fact that the library waits synchronously only up to 10 messages limits it's usefulness in building event processing when processing takes some time (e.g. webhooks). You can take a look at https://github.com/caiokf/sqs-queue-parallel.git and either use that project or modify/extend this one by not waiting for handleMessages, but queuing it (see https://github.com/caiokf/sqs-queue-parallel/blob/7b8ba01f6c75de4f2c34a6ae4b00a59ef2790fc5/dist/sqs-queue-parallel.js#L126-L127 to queue the messages up to X). I'm not familiar with coffee this project used, but can rework it or merge with sqs-consumer, haven't decided yet. |
Beta Was this translation helpful? Give feedback.
-
@dginzbourg @utkarshdeep I come with the same dilemma than both of you, and wonder if we can have n consumers instances on a same Nodejs app. Would there be anything preventing it inside the lib? We're using Kubernetes, and are already having concurrent consumers on different pods. We don't see (yet) what would go wrong having a concurrent consumers inside the same pod. |
Beta Was this translation helpful? Give feedback.
-
@dginzbourg Hey! Any plans to keep working on that fork upstreaming? Is there anything I could help with? |
Beta Was this translation helpful? Give feedback.
@utkarshdeep I'm coming exactly with the same dilemma. The fact that the library waits synchronously only up to 10 messages limits it's usefulness in building event processing when processing takes some time (e.g. webhooks). You can take a look at https://github.com/caiokf/sqs-queue-parallel.git and either use that project or modify/extend this one by not waiting for handleMessages, but queuing it (see https://github.com/caiokf/sqs-queue-parallel/blob/7b8ba01f6c75de4f2c34a6ae4b00a59ef2790fc5/dist/sqs-queue-parallel.js#L126-L127 to queue the messages up to X). I'm not familiar with coffee this project used, but can rework it or merge with sqs-consumer, haven't decided yet.
I see this PR ht…