arempe93 / bunny-mock

A mock client for RabbitMQ modeled after the Bunny client in ruby
http://www.rubydoc.info/github/arempe93/bunny-mock
MIT License
44 stars 37 forks source link

implement basic dead letter exchange behaviour #36

Open aiomaster opened 7 years ago

aiomaster commented 7 years ago

I tried to implement a basic handling of dead-letter-exchanges. If a message gets nacked or rejected it could be delivered in a dead letter exchange if specified in the arguments parameter of the queue options. See here for details: http://rubybunny.info/articles/extensions.html#dead_letter_exchange_dlx

I would be glad to get some feedback on this PR cause I don't know if this is a good idea and if the code is good enough.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 6729e0d6dce8cf42f28a2faa5a28d8b2145695f4 on webit-de:master into 468fe867815bd86fde9797379964b7336d5bcfec on arempe93:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling b53c0fd04aca095b48fd2b49b01a21c5df2c79d5 on webit-de:master into 468fe867815bd86fde9797379964b7336d5bcfec on arempe93:master.

arempe93 commented 7 years ago

hey @aiomaster - thanks for the PR! i'll try to take a look and merge it soon 👍

aiomaster commented 7 years ago

@arempe93 This would be great! I just tested it for direct exchanges with queues having a dead letter queue and the only way to get dead letters with bunny mock for now is by rejecting the message. It would need more effort to simulate a dead lettering because of message timeout. The last dead letter reason is a full queue, but this is also difficult with bunny-mock, cause you have to define what "full" means.