5월, 2023의 게시물 표시

RabbitMQ -Python Client #6 : MQ Connection Management

이미지
 Applications that need to maintain persistent MQ connections should take special care to manage MQ connections. I recently created a daemon application that sends messages to Rabbit MQ, but I remember having a hard time with connection management. I have prepared several guides for managing Rabbit MQ connections. In this article, we will use Python instead of C/C++. Therefore, we will use pika, a Python module for Rabbit MQ. Preparations First, Exchange and Queue are created in Rabbit MQ in advance as follows. If you want to know more about Queue and Exchange, please refer to the following pages in advance. RabbitMQ Tutorials RabbitMQ - C++ Client #3 RabbitMQ - C++ Client (Exchange) #4 According to the settings above, if a message is transmitted using the routing key rk_A to Exchange sample_ex, it is stored in queue QA, and if a message is transmitted using routing key rk_B, it is stored in queue QB. Application for one-time sending of messages Before looking at MQ conne...