I am trying to use RabbitMq in a more unconventional way (although at this point I can choose any other implementation of the message queue, if necessary). Instead of leaving Rabbit messages for my consumers, the consumer connects to the queue and receives a packet of N messages (during which he consumes some and possible deviations from some), after which he switches to another queue and so on. This is done for redundancy. If some consumers harm, all messages are guaranteed to be consumed by another consumer.
The problem is that I have several consumers, and I do not want them to compete for the same line. Is there a way to guarantee queue blocking? If not, can I at least make sure that if 2 consumers are connected to the same queue, they do not read the same message? Transactions can help me to some extent, but I heard that they will be deleted from RabbitMQ.
Other architectural suggestions are also welcome.
Thanks!
EDIT: As pointed out in the comment, there is a peculiarity in how I need to process the messages. They only make sense in groups, and there is a high probability that related messages are grouped together in a queue. If, for example, I print a package of 100 messages, there is a high probability that I can do something with messages 1-3, 4-5.6-10, etc. If I canβt find the group for some messages, Iβll re-send them to the queue. WorkQueue will not work, because it will distribute messages from one group to several workers who would not know what to do with them.
Cristian vrabie
source share