0

I have tasks with an ids, and each task has some amount of jobs to do:

  • every job for each user;
  • for each task, number of users and jobs are different.

And I want to put all the jobs to one queue with name task{id}, so I can control when the task is done (by empty queue task{id}), and automatically delete it with rabbitMQ help, and control a number of consumers working on one task{id}.

And I want my consumers works all the time like daemons and choose the queues with jobs automatically to work with.

The main question here is how to get name of a task inside a consumers to bind them to it? Or maybe there can be some another trick with rabbitMQ to do so, without knowing name of a queue?

1 Answer 1

0

You need to use the Event Exchange Plugin , this plugin allows you to consumes internal events and re-publishes them to a topic exchange, thus exposing the events to clients (applications).

You can bind to queue.created Event which will give you the name of the queue in the message header and you can then use it to bind your consumer to that specific queue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.