sakaiproject/Hilary — pull request #314 by mrvisser (2013-02-06 23:45:02+00:00)
Title: Defer binding of MQ workers until end of server startup cycle

Currently when starting up an application server, the MQ workers are potentially attached before the server is ready to handle the MQ events.

One example is search, where the content module may register a document producer, while the search module attaches the indexing worker to RabbitMQ earlier in the startup cycle. When the MQ worker gets attached, the content document producer is not registered yet and indexing tasks start flowing.

The easiest way to fix the issue I think is for the MQ module to buffer registration of the workers, and have a step at the end of the startup cycle to finally initiate the RabbitMQ connection and attach the workers. This solution is only achievable while MQ is still managed by the oae-util module, as it has full control of the startup sequence.

This also might be an indication that our startup sequence might need a little more TLC. E.g., rather than "priority", we could establish start-up sequence based on a "before" or "after" property:

e.g., `after: [ 'oae-util', 'oae-search' ]`

Such an impl. would need a bit more thought into avoiding unachievable configurations (e.g., cyclical "before" chains)