当前位置: 动力学知识库 > 问答 > 编程问答 >

windows - Evoke a nack in publisher confirm mode

问题描述:

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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: