[rabbitmq-discuss] listnening on two queues
Jano Kianicka
kianicka123jano at yahoo.com
Sat Feb 22 10:55:39 GMT 2014
Dear RabbitMQ users and developers,
We are starting now implementation of one project for an enterprise system where we replace Oracle Tuxedo by an open source solution. There are implemented more Tuxedo servers in C, which can receive signals and messages from Tuxedo queues and direct calls as well. The servers are also monitored and controlled by Tuxedo. We are implementing proof-of-concept by migrating original code and replacing original Tuxedo calls with RabbitMQ functionality. We use librabbitmq (rabbitmq-c client library of AMQP).
And I have several questions:
1. When we use routing messages through a custom exchange and bindings, and if there is some error, for instance wrong queue name or wrong routing key given, is it possible to obtain some error response from RabbitMQ server? Up to now what I did testing, the messages were just silently lost.
2. We are thinking about having clients and producers controlled by special set of queues. So one component will listen on two or more queues. One will deliver business process messages which carry data processing information, but other queue will carry control commands. This control queue must have higher priority even when main business process queue is full of messages. I did the following test:
/* Initialization of consuming properties - consumer priority */
amqp_table_t queue_table;
amqp_table_entry_t entry;
entry.key = amqp_cstring_bytes("x-priority");
entry.value.kind = AMQP_FIELD_KIND_U32;
entry.value.value.u32 = 1;
queue_table.num_entries = 1;
queue_table.entries = &entry;
/* Start listening on two queues */
while (1) {
amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename1), amqp_empty_bytes, 0, 0, 0, amqp_empty_table);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename2), amqp_empty_bytes, 0, 0, 0, queue_table);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
But when this consumer test was executed, the following error occured:
queue2 x-priority: 1
Consuming: a socket error occurred
When there was amqp_empty_table for both, it was consuming messages from both queues but in a random manner, sometimes even 4 messages from one and then three messages from the other. We need to have higher priority on the control queue.
Don't you have some experience or idea what should be changed to call the basic_consume correctly?
3. We appreciate very much that there is more verbose documentation of methods in rabbitmq-c. But I miss a little documentation of possible options for various structures, for instance the structure amqp_basic_properties_t, what are possible options for content_type, content_encoding etc. Where is most proper place to seek for this input arguments options?
Thank you very much for any advise.
Kind regards
Jan Kianicka
AWST, Wien
Austria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140222/3b70c29e/attachment.html>
More information about the rabbitmq-discuss
mailing list