qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Questions of qpid-route usage
Date Mon, 24 Feb 2014 17:56:41 GMT
On 02/24/2014 10:24 AM, Gao, Jie (Kyrie, HPIT-DS-CDC) wrote:
> Hi Pavel Moravec,
>
> Thanks for explaining to me. I am trying to understand you. So the answers for my questions
are:
>
>> If we want to add a route between 2 brokers, we can use qpid-route
>> route add ip:port ip:port exchange_type routingkey. Which means:
>>
>> A-->B
>>
>> A is a fake client and B will be the server. B will store all the
>> route information and also will be waiting for A's data. Inside qpid
>> it uses TCP protocol, so I guess B will be the server in the lower level(am I right?).
>
> Yes, B is the server and A is the client.

Correct, the qpid-route tool will connect to the first broker details 
and ask it to create the route/link. The first broker will then 
establish a TCP socket to the second and after going through the AMQP 
connection protocol, (by default) subscribe to receive messages as directed.

It is therefore A that records the existence of this interbroker link. 
 From the point of view of B, A is (almost) just like any other client.

>> In this way, we can add a route without broker A. Which means, even if
>> we didn't start A, the route would still be added successfully. The problem is:
>> Can we always do this thing? Ummm...if we let A missing for a very
>> long time (at this time B and the route will always exist), then we start A again.
>> Does it still works?
>
> The answer of this question is NO. After several reconnection tries between 'A' and 'B'
are over, 'B' will never try to link to 'A'.

The broker B doesn't really know about the route. It is A that has that 
knowledge. It is always A that will attempt to re-establish the 
connection. If the connection between them is broker A will keep 
retrying indefinitely to reconnect. A can also durably record the 
details of the link such that if it restarts it can again resume trying 
to establish the connection.

>> Also, if we let the route existed in B, will B
>> being busy(waiting for A's data) all the time?
>
> Since 'B' will never try to link to 'A', 'B' will not be busy all the time. But there
is another question: why we still can see the link information by running "qpid-route route
list xxx"? If the link between 'A' and 'B' is dead, I think it's better to delete the bad
route automatically. And next time when 'A' starts to run again, we cannot reuse this route,
instead we have to delete the route by using "qpid-route route del xxx" first and then using
"qpid-route route add xxx" .

The existence of a link definition is considered distinct from the 
active state of that route. If you run qpid-route add route A B, then 
run qpid-route list B, you would not see the route. If you ran 
qpid-route list A you would see the route and its status would indicate 
whether it was currently active or not.

>> Another question is when we use -s option in qpid-route. I saw the
>> help document it said: " Configure the route in the source broker
>> (create a push route)." So does it mean A will be the server and B
>> will be the fake client here?
>
> The answer for this question is NO(according to your email). 'A' will still be the client
and 'B' will be the server. The only difference(after a tcp link established) between '-s'
and NOT '-s' is route information will be saved in 'A' instead of 'B'.

A will still be the client of B and the details of the link will be 
stored in A. The only difference is that the messages will flow in the 
opposite direction. I.e. instead of A pulling messages from B, it will 
push messages to B (when the link is active).

Hope this helps. I do agree that the tool is confusing to use.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message