Changeset 971 for trunk/Monitoring
- Timestamp:
- 11/22/13 12:34:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Monitoring/CNClient/send_AMQP_msg.c
r962 r971 365 365 die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel"); 366 366 367 amqp_exchange_declare(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("fanout"), 0, 0, amqp_empty_table); 367 //amqp_exchange_declare(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("fanout"), 0, 0, amqp_empty_table); // fanout exchange (i.e. without routing key) 368 amqp_exchange_declare(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("direct"), 0, 0, amqp_empty_table); // direct exchange (i.e. to be used with routing key) 368 369 die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange"); 369 370 … … 371 372 die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring queue"); 372 373 373 amqp_queue_bind(conn, 1, amqp_cstring_bytes("myqueue"), amqp_cstring_bytes("myexchange"), amqp_cstring_bytes(""), amqp_empty_table); //no need for binding key as we use the fanout exchange type 374 //amqp_queue_bind(conn, 1, amqp_cstring_bytes("myqueue"), amqp_cstring_bytes("myexchange"), amqp_cstring_bytes(""), amqp_empty_table); //no need for binding key as we use the fanout exchange type 375 amqp_queue_bind(conn, 1, amqp_cstring_bytes("myqueue"), amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("myroutingkey"), amqp_empty_table); //we use a binding key here as we use the direct exchange type 374 376 die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding"); 375 377 … … 382 384 383 385 for (i = 0; i < msg_count; i++) 384 die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes(" "), 0, 0, &props, amqp_cstring_bytes(body)), "Publishing");386 die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("myroutingkey"), 0, 0, &props, amqp_cstring_bytes(body)), "Publishing"); 385 387 } 386 388
Note: See TracChangeset
for help on using the changeset viewer.