AMQP and queue "chunks"?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
It is necessary to organize the message queue with "a La carte" return customers. For example:


arrived to a queue of 1000 messages per interval 1-2 seconds, you need to give the queue handler 100 messages per second.


Now all organized on RabbitMQ, but such settings are not found, reading documentation and gugleniya gave nothing, it seems this mode is not supported. Tell me the most TRU solution.
by | 12 views

2 Answers

0 like 0 dislike
Supports, using prefetch.
For ruby code will be something like this:
\r
\r
mq_conn = AMQP.connect mq = MQ.new(mq_conn).prefetch(100) mq.queue("queue").subscribe do |header, message| # processing... end 

However it does not regulate the upload speed, but the message recipient will be sent a batch of 100 pieces. Therefore, if multiple recipients, the 1000 messages will be sent between portions of 100 pieces.
\r
If you want exactly 100 messages per second, you apparently need to manually use .pop with the desired interval.
by
0 like 0 dislike
I'm not sure, but it sure is in the JBoss HornetQ
by

Related questions

0 like 0 dislike
2 answers
asked Mar 25, 2019 by Horzerus
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
22,996 users