teamsnap/emque-producing — pull request #13 by ryanwi (2014-10-07 05:04:45+00:00)
Title: Fixes #10 makes messages mandatory and raise if not sent

The goal here is to avoid message loss. With RabbitMQ, if there are no queues bound to an exchange and you publish to that exchange the message will be dropped. Making it `mandatory` will handle this situation by returning the message to us in order to do something with it. That something we want to do with it is retry it in sidekiq/resque after addressing the root problem.

This update implements the same interface that the kafka publisher had with a return of true or false to represent the fact that the messages was sent. It also removes the exception handling so that both 1) exceptions during publishing and 2) messages not being sent (are mandatory and returned) would fail the publish job in resque/sidekiq so that the publish job can be retried when the problems have been addressed.