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 Wed, 26 Feb 2014 11:14:47 GMT
On 02/25/2014 06:16 PM, Gao, Jie (Kyrie, HPIT-DS-CDC) wrote:
> I still have some questions. Hope I didn't bother you too much.

Not at all!

> I will still use this model to explain my question.
>
> A(on node 1) ---> B (on node 2)

Does the direction of the arrow indicate the flow of messages?

>> 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.
>
> The first broker in qpid-route is dest broker. Do you mean 'B' here?

If B is the broker to which the messages should go, then yes, it would 
be the destination broker.

> But from your next explanation 'A' sounds more reasonable.

I assumed A and B were the first and second brokers passed to the 
qpid-route command. It sounds like you are using those labels with some 
additional meaning (e.g. that messages flow from A to B?)

> But..er..but why we can establish a route without 'A'? I mean I can use "qpid-route route
add B A xxxx xxx" to create a route successfully (well I just see no error return) when 'A'
is actually missing. I can later start to run broker 'A'. so if 'A' is the one which need
to link to 'B', how can it possibly know who is 'B'? since when we run qpid-route to add a
route, we don’t have 'A'.

Again, the definition of the route is considered separately from its 
actual status at any time. The qpid-route tool only connects to *one* 
broker. The other broker is passed to the first broker as the details to 
which that first broker should connect to. The route is defined once the 
first broker is told about the details. That broker will then 
asynchronously attempt to establish the link (and will retry until it 
does, and will also keep retrying if it is then ever disconnected).


>> 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.
>
>> 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.
>
> It sounds that if 'A' and 'B' are both active and also route is there. The connection
between 'A' and 'B' will always be okay? But in one of our project we have met such problem
(well it's very hard to reproduce): node 1 where 'A' is running is down and after for a while
node 1 is up again and 'A' is also active again. We check 'A' and 'B', both are running. And
we also check "qpid-route route list xxx" and found there is a route between 'A' and 'B'.
but the result is there is no message flow between 'A' and 'B'.

What was the status of that route? Were there any errors in the broker 
logs (on either broker)?

Some additional debug information would be listing the queues bound to 
the exchange the route is from (qpid-config -R exchanges) and getting 
details of the connections and subscriptions that are active (qpid-stat 
-c and qpid-stat -u respectively).

> after we kill 'B' and restart 'B' and use "qpid-route route add B A xxx xxx", everything
is okay then. So it sounds there is a stale route between 2 brokers. If 'A' can durably record
the details of the link and even it can establish the connection after it resume. Er..I don’t
think this issue will happen. Wait. How can 'A' record the details? Maybe save information
in a file? Maybe it's because 'A' lost these information?
>
>
> To summarize my questions:
> 1) what will happen when only broker 'B' is active and meanwhile we run "qpid-route route
add B A xx xxx" to add a route? According to Pavel Moravec's mail, 'B' will try to link to
'A' for several times until it gives up.

B will try to link to A forever (or at least until the route is deleted).

> But you just said it's 'A' which will establish the route. I felt confused here.

Sorry, that was my misunderstanding of what was implied by the labels A 
and B. (As above, I had assumed A was the first parameter to qpid-route 
and B was the second)

> 2) Is it possible to have both 'A' and 'B' and route available but still cannot pass
the message?

Yes, it is possible that A and B are up, and that a link is defined, but 
that it is not active due to some error condition. The status should be 
communicated by listing the route, and the broker logs would contain 
errors if any occurred.
> 3) sorry I just think one more problem: I just noticed that there is an option called
" -d, --durable         Added configuration shall be durable". I found the explain " A durable
route survives broker restarts, restoring a route as soon as both the source broker and the
destination are available. If the connection to a destination is lost, messages associated
with a durable route continue to accumulate on the source, so they can be retrieved when the
connection is reestablished.".  So if I added -b when I add a route, would it be helpful to
solve the question 2?

If the problem is that the broker on which the route is defined restarts 
and therefore loses its definition of the route, then yes, making the 
route durable would help (you need to ensure you have a store enabled in 
order for the persistence to actually work).


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


Mime
View raw message