0

I have a RabbitMQ Consumer Java application that keeps on checking for the new message on the queue with a while(true) loop.

Is there any solution so I can avoid following Sonalint Blocker bug without suppressing the error:

Loops should not be infinite

Reference : https://rules.sonarsource.com/java/RSPEC-2189

nikhil2050
  • 27
  • 5
  • Please show a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) and link to the [rule](https://rules.sonarsource.com/) you are talking. – howlger Jan 06 '22 at 07:52
  • Reference: https://rules.sonarsource.com/java/RSPEC-2189 – nikhil2050 Jan 06 '22 at 09:18
  • 1
    According to the RabbitMQ documentation no `while (true) { ... }` loop is needed for that: https://www.rabbitmq.com/api-guide.html#consuming – howlger Jan 06 '22 at 14:01

0 Answers0