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