qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjw tectec <jjw.tec...@gmail.com>
Subject Re: federated broker system - end-to-end messaging not working
Date Tue, 19 Jan 2016 17:23:02 GMT
Hi Gordon,

Yes, changing the key name to queue name made messages flow end-to-end.
I had also suspected that the routing key wasn't set the way I wanted it
be. So I had tried to set and get routing-key property at the client sides:

publisher:
msg.setProperty("x-amqp-0-10.routing-key", "keyX");

subscriber:
cout << msg.getProperties()["x-amqp-0-10.routing-key"].asString();

But the above code caused the following compilation errors:

/usr/bin/ld: /tmp/ccNXSPL7.o: undefined reference to symbol
'_ZN4qpid5types7VariantD1Ev'
//usr/local/lib/libqpidtypes.so.1: error adding symbols: DSO missing from
command line

Do you know why was that?
Thanks very much

jjw

On Mon, Jan 18, 2016 at 4:20 AM, Gordon Sim <gsim@redhat.com> wrote:

> On 01/15/2016 07:17 PM, jjw tectec wrote:
>
>> Hello,
>>
>> I'm trying to set up a federated broker system and testing 3 brokers so
>> far: B1->B2->B3. I'm not seeing messages published to B1 received by
>> subscriber attached to B3. However, in my tests, Pub->B1->B2->Sub and
>> Pub->B2->B3->Sub are both working. Below are some configuration details
>> that I've used. Can somebody help?
>>
>> Script for creating queues/exchanges, bindings, and routes:
>> qpid-config -a $B1 add queue $QUEUE --durable
>> qpid-config -a $B2 add queue $QUEUE --durable
>> qpid-config -a $B2 add exchange topic $EX --durable
>> qpid-config -a $B3 add exchange topic $EX --durable
>>
>>   qpid-config -a $B2 bind $EX $QUEUE keyX --durable
>>
>>   qpid-route -v -d queue add $B2 $B1 $EX $QUEUE
>>   qpid-route -s -v -d queue add $B3 $B2 $EX $QUEUE
>> =================
>>
>> In the publisher code:
>> address.setType("queue");
>> msg.setSubject("keyX");
>>
>> In the subscriber code:
>> address.setType("topic");
>>
>> ==================
>> When doing:
>>    Pub -> B1 -> B2 -> B3 -> Sub
>> I was hoping that the message will carry "keyX" as the routing key, gets
>> published into B1's queue, delivered into B2's exchange, then B2 will use
>> "keyX" to route message into B2's queue, delivered into B3's exchange,
>> delivered to Sub.
>>
>> But since I'm not seeing messages flow from one end to the other, looks
>> like B2's binding between its exchange and queue is not working the way I
>> wanted it to. Am I missing something?
>>
>
> The way that AMQP 0-10 is defined, the 'destination' of a transfer is
> always an exchange. When sending 'direct' to a queue, the qpid::messaging
> library will set the destination to '' (the so-called 'default exchange')
> and set the routing key to the queue name. (If there is a subject that is
> different from this, it will be carried as an application property named
> 'qpid.subject').
>
> So in your case the message as published to 'queue' on B1 will not have
> the routing key set to 'keyX' as you expect, and hence it will be dropped
> by B2 as there is no matching binding.
>
> Would it be possible to rename 'queue' on B1 as 'keyX' (or use 'queue' as
> the key in the binding against the exchange pn B2?
>
> Alternatively, could you change the exchange used to be a fanout exchange
> and not require key based bindings?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message