v.23.4Improvement

Fix data race in RabbitMQ and refactor code

Fix data race in RabbitMQ (report), refactor the code. #48845 (Kseniia Sumarokova).
Fixed a data race condition in the RabbitMQ engine and refactored the related code.

Why it matters

This fix addresses a concurrency issue (data race) in the RabbitMQ integration, improving stability and correctness when consuming messages. The refactoring enhances code maintainability and robustness.

How to use it

Users benefit from this fix automatically by updating to the version including this patch. No changes to configuration or usage are required.