c - AMQP RabbitMQ consumers blocking eachother? -


"itemprop =" text ">

I have coded a C (RabbitMQ-C) worker application which is published by a linear Python script (pica) consumption.

I have the following strange behavior that I can not seem to solve:

  1. Launching all the workers before the messages are published, the expected work
  2. 1 workers have been published as queue after the start of work
  3. However: after the start of additional workers means a worker has started taking from the queue That those workers (any message on the queue Do not see the message count = 0) and therefore just wait (there are still many messages in the queue due to the incident) The killing of the first worker will begin suddently messages all flown for waiting in all other (waiting) consumers.

Any ideas what can be happening?

I am sure that every consumer has its own channel (is it necessary?) But still the same behavior ...

Consumers ( Worker) Here's the code for:

The problem here is most likely that all messages are pre-installed when your user starts - Receives. This is the default behavior by RabbitMQ, but if you can reduce the number of messages brought before by the consumer, then you better allow to spread the workload across multiple workers.

This means that one or more consumers will pick up all the messages, and none will leave the new consumers.

If you apply QoZ to your subscriber and limit pre-fetch to say 10 messages. Consumers will queue up to only 10 first messages, and new users can lift loose.

The function you are looking at to implement it is called, and in addition to this you get the consumer- prefetch


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -