Rabbitmq search messages

718 views
Skip to first unread message

User123

unread,
Feb 2, 2015, 12:20:28 AM2/2/15
to rabbitm...@googlegroups.com
I am new to rabbitmq.

I want to integrate it into my app but I am not sure how I can achieve this particular functionality.
  • Producer app creates multiple jobs for single client and sends it to the queue. These jobs have a common request id (May be correlation id).
  • Now the consumer consume the jobs in any order and sends the acknowledgement.
  • After the producer receives a acknowledgment, the producer has to check in the queue how many jobs are still pending for that particular job(using the request id). If no jobs are pending it means all the jobs for that client are complete and it can send the response back to the client.
Is it possible with rabbitmq? If not what can be the alternatives?

Any help would be highly appreciated.

Thank You.

Michael Klishin

unread,
Feb 2, 2015, 12:25:06 AM2/2/15
to rabbitm...@googlegroups.com, User123
 On 2 February 2015 at 08:20:30, User123 (twist...@gmail.com) wrote:
> I want to integrate it into my app but I am not sure how I can achieve
> this particular functionality.
> Producer app creates multiple jobs for single client and sends
> it to the queue. These jobs have a common request id (May be correlation
> id).
> Now the consumer consume the jobs in any order and sends the acknowledgement. 

This is similar to what tutorial 6 describes and RabbitMQ message properties have both
correlation id and message id fields:
http://www.rabbitmq.com/getstarted.html

> After the producer receives a acknowledgment, the producer
> has to check in the queue how many jobs are still pending for that
> particular job(using the request id). If no jobs are pending
> it means all the jobs for that client are complete and it can send
> the response back to the client.

You can query for how many messages there are enqueued but not query queue contents.

> Is it possible with rabbitmq? If not what can be the alternatives?

You can use RabbitMQ in conjunction with a data store that provides sets (Redis and Cassandra come to mind).
Producer and consumers then will add and remove elements to the set (a set per correlation id)
and RabbitMQ will cover what it's good at: routing and delivering messages, handling acks on both ends,
and so on.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages