I am using java based application to publish & consume RabbitMq services for message exchanges.
So architecture is pretty simple
Java application which produces & consume messages from RMQ nothing too much complex.
Case or rather problem statement is I am publishing messages to RMQ in a huge load lets say 10 messages per second. with sample below format in JSON data
{"id":"a:1143-fdf45-34fd4-23d23f", "class":"AClass"}
{"id":"a:2243-fdf45-34fd4-23d23f", "class":"BClass"}
{"id":"a:3343-fdf45-34fd4-23d23f", "class":"AClass"}
{"id":"a:4443-fdf45-34fd4-23d23f", "class":"CClass"}
and for some reason the messages took considerable longer time to process, and by that time next messages are already published.
in this case, I am wanted to reshuffle or reorder the messages which are placed in RMQ or already published to RMQ (group by id, class).
does RMQ allows me to inject such type of stratergy ?
If not then is there work around to reorder before publishing the messages to RMQ ?
since in my Microservice, controller receive the POST request for single object and it will do channel.basicPublish as of now this is straight forward flow. main objective is to not to de-duplicate, but rather arrange them in a custom sequence.
AClassmay have priority 1,BClassmay have priority 2, etc)valuesare obviously dynamic one. there are several values for typeclassand so is foridas well. but I would like to know what is your theory behind priority1 & priority2 ?AClass,BClass,AClass], clients will first fetch 2xAClassand afterwards theBClass(assuming AClass has higher priority). So grouping by class (or any attribute for which you know possible options when configuring rabbit queue) is sort of possible.