Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Subscribe to a Topic, and then Batch the messages #1826

Unanswered
wernermorgenstern asked this question in Q&A
Discussion options

On our system, we use MQTT.js in our service.
We subscribe to a shared topic (MQTT Broker is VerneMQ).
Then on each message, we add it to a Queue/Messaging Service (BullMQ Pro and Redis)

What I was wondering if the following is possible:
When we ingest the messages, and process them, instead of adding each message to the BullMQ Queue separately, I was wondering, if there is a way to ingest the messages, check one thing (Topic needs to contain string v1.0), and then create an Array, and use the Bulk Add Jobs Functionality for BullMQ Pro.

So processing each message, and then bulk add all of them in one command.

We want to receive messages, for like 50,000 Devices, which send a message every 10s.
So for 50,000 Devices, it could mean 50,000 Messages in one second.

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

I was wondering, if there is a way to ingest the messages, check one thing (Topic needs to contain string v1.0), and then create an Array, and use the Bulk Add Jobs Functionality for BullMQ Pro.

@wernermorgenstern Sorry but It's not very clear to me what you would like be able to do on MQTTjs side.

You must be logged in to vote
0 replies
Comment options

What I am asking, if there is a way in the Handler Function, to process messages individually, and then collect them together, and then run one command, when a certain Threshold is reached, to act on a Group of processed messages.

You must be logged in to vote
1 reply
Comment options

just create an array, push messages into it when they arrive and then when the array size you want is reached trigger the command?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /