title: Message queue with consumer-based loading balancing
body: <p>Reading the documentation of common message queueing systems (e.g. RabbitMQ, ActiveMQ) it seems that load balancing is always done by the queueing system (round-robin) or by the producer using several queues or attributes on messages. However in our application nobody, not even the consumers, knows how long it will take to process a message. It can be between several milliseconds to hours (it's basically computing an arbitrary function f on an arbitrary input x). Therefore load balancing should be performed by the consumers in that they only accept messages if their "load" is below a threshold (load can be number of executing jobs, CPU load, etc.). Ideally the producer puts a message in the queue, the message is "offered" to all consumers, but only exactly one consumer accepts and processes the message. It may even happen that no consumer accepts it in the first round and it stays in the queue until one consumer has free resources.
  So may question is: is this somehow possible with any of the common message queueing system or are we looking in the wrong direction?</p>