Evoke a nack in publisher confirm mode

对着背影说爱祢 提交于 2019-12-24 21:09:12

问题


What are the possible reasons for a Nack to occur in publisher confirm mode, and can a Nack be reliably produced for testing, short of pulling a cable to the disk or other hardware-based actions?

E.g. sending to a non-existing exchange does not lead to a Nack. It leads to a channel close, just like in non-confirm mode.

Btw my rabbit cluster is running on Windows boxes, which might matter, as the file system works quite differently from those in the unix world.


回答1:


One way to generate Nacks is to

  1. create a virtual hard disk
  2. configure the environment variable RABBITMQ_MNESIA_BASE to point to a folder on that drive
  3. reinstall the RabbitMQ service so the changed mnesia base dir is picked up
  4. restart the service
  5. take the virtual hard disk offline while enqueueing messages

A test confirmed that that will actually result in a Nack.



来源:https://stackoverflow.com/questions/18116661/evoke-a-nack-in-publisher-confirm-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!