[openamq-dev] missing routing key

Pieter Hintjens ph at imatix.com
Sun Feb 17 19:43:00 CET 2008


On Feb 11, 2008 9:28 PM, Dmitri Tsyganov <dmitri.tsyganov at dowjones.com> wrote:

> When my client app connects to a broker in claster_mta configuration, I
> can't retrieve routing key from the message. I am using
> amq_content_basic_get_routing_key API

OK, found the problem.  Routing keys are taken from the content
properties, which were not being properly set on forwarded messages.
Here is a patch you can apply to the OpenAMQ code to fix the bug:

In openamq/server:

--- amq_cluster_mta.icl	(revision 10964)
+++ amq_cluster_mta.icl	(working copy)
@@ -200,6 +205,12 @@
         client_method->content = peer_method->content;
         peer_method->content = NULL;

+        amq_content_basic_set_routing_key (
+            client_method->content,
+            peer_method->payload.basic_deliver.exchange,
+            peer_method->payload.basic_deliver.routing_key,
+            0);
+
         amq_exchange_publish (self->exchange, NULL,
(amq_server_method_t *) client_method);
         amq_client_method_unlink (&client_method);
     }

To rebuild, do "boom regen build install" in openamq/server.

-Pieter


More information about the openamq-dev mailing list