- this program uses rabbitmq-c library (v0.3.0) - https://github.com/alanxz/rabbitmq-c - library installation - using system package - install using commands below - aptitude install librabbitmq0 - aptitude install librabbitmq-dev - note that it is likely that system packages versions are out of date (we need v0.3.0) so better use installation from source - from source - retrieve source - wget https://github.com/alanxz/rabbitmq-c/archive/rabbitmq-c-v0.3.0.zip -O rabbitmq-c-v0.3.0.zip - unzip rabbitmq-c-v0.3.0.zip - cd rabbitmq-c-v0.3.0 - compilation using autoconf (automake v1.9+, and libtool v2.2+) - autoreconf -i - if error occurs at this step, check requirement below - we require autotools v2.63 or better to build. I think RHEL5 ships with v2.59 which lacks the AC_PROC_CC_C99 macro. - You can do one of two things; - Install a newer version of autotools - Build using cmake (v2.6 or better). - ./configure --enable-static - make - make install - compilation using cmake (CMake v2.6+) - mkdir build && cd build - cmake -DBUILD_STATIC_LIBS=True -DBUILD_SHARED_LIBS=True .. - cmake --build . - make - you got error AAA below, it's normal make[2]: *** Pas de règle pour fabriquer la cible « librabbitmq/librabbitmq.so.1.0.1 », nécessaire pour « examples/amqp_bind ». Arrêt. make[1]: *** [examples/CMakeFiles/amqp_bind.dir/all] Erreur 2 make: *** [all] Erreur 2 - make (because of the above error (AAA), you need to run make twice) - make install - compilation (static) - gcc -static -I/usr/local/include -L/usr/local/lib -Wall -o sendAMQPMsg send_AMQP_msg.c -lrabbitmq - we get warning below during compilation - <--- /usr/local/lib/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function `amqp_open_socket': rabbitmq-c-rabbitmq-c-v0.3.0/librabbitmq/amqp_socket.c:66: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ---> - it means that you may need to be sure all computing node have the same glibc version !!!! - also means that a different binary must be use in each computing center - usage - to send a message in the queue, do - ./sendAMQPMsg localhost 5672 test - note - to show how many messages are in the queue, do as root - ./rabbitmqctl list_queues