I am using RabbitMq with AMQP and Symfony2.
I have an issue where I have multiple workers and when I get multiple messages from the same type queued, they are picked up by the consumers and they start working on the same Entity and overwrite each other's data (the same consumer gets executed on 2 or more workers at that point).
I have tried setting a property on the Entity when the first message starts, so when some other comes and checks against it it re-queues the message if the Entity is in use but this still doesn't fix the problem as the DB query is slower than the time it takes to consume the messages.
Is there a way the messages can communicate between each other or set flags somehow in the RabbitMq maybe so that another message can check against that so I avoid this parallel consumer execution on the same Entity?
Thank you