글

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...

unixODBC Programming - improve performance using multiple statements

이미지
 ODBC programming generally has the following structure. And the SQL query statement is processed using the statement handle. However, if there are many sql statements to be processed, the above structure should use one statement handle to process the work sequentially. However, RDBMS such as MySQL, MariaDB, MS-SQL, and DB2 are parallel structures that process multiple commands at the same time. Therefore, it is advantageous to create multiple statement handles and process them simultaneously. <parallel processing> Determining whether the RDBMS supports parallelism ODBC SDK provides an API to know the number of statement handles that RDBMS can support simultaneously. You can use the SQLGetInfo function. SQLUSMALLINT max_concur_act = - 1 ; rc1 = SQLGetInfo(dbc, SQL_MAX_CONCURRENT_ACTIVITIES , & max_concur_act, 0 , 0 ); if (SQL_SUCCEEDED(rc1)) { if ( 0 == max_concur_act) printf( "SQL_MAX_CONCURRENT unlimited or und...