1

I'm using Publisher Confirms with RabbitMQ. I would like to test my code, where I'm handling the unacked messages (handleNack method). How can I create the scenario to receive Nacks from the broker? Stopping the broker or publishing the messages to a queue which has reached its limits, does not help at all..

Thanks in advance..

ch.setConfirmListener(new ConfirmListener() {
    public void handleAck(long seqNo, boolean multiple) {
        if (multiple) {
            unconfirmedSet.headSet(seqNo+1).clear();
        } else {
            unconfirmedSet.remove(seqNo);
        }
    }
    public void handleNack(long seqNo, boolean multiple) {
        // handle the lost messages somehow
    }
}
reuben
  • 3,360
  • 23
  • 28
Casper
  • 107
  • 2
  • 12

0 Answers0