You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "RatTac@web.de" <Ra...@web.de> on 2016/01/20 12:03:11 UTC

Heartbeating - Java broker

Hi,
I'm having a problem to find out how heartbeating exactly works for the java
broker (or how to enable it).
Via the http management I configured the broker to have a "heartbeat delay"
of 5s (this was the only option I could find to somehow enable
heartbeating).

My test client connects also with heartbeat:5 in the connection options.
After connection the client perform a while(1); to simulate a client crash.

In my understanding the broker should notice after a few seconds that the
client is not sending a heartbeat back and thus the connection should be
terminated. However, this is not happening.

Am I missing something, or am I performing the wrong test-scenario to test
heartbeating?

Regards



--
View this message in context: http://qpid.2158936.n2.nabble.com/Heartbeating-Java-broker-tp7636881.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: Heartbeating - Java broker

Posted by "RatTac@web.de" <Ra...@web.de>.
Thanks, this was very helpful



--
View this message in context: http://qpid.2158936.n2.nabble.com/Heartbeating-Java-broker-tp7636881p7636966.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: Heartbeating - Java broker

Posted by Gordon Sim <gs...@redhat.com>.
On 01/21/2016 11:52 AM, Rob Godfrey wrote:
> On 21 January 2016 at 11:37, RatTac@web.de <Ra...@web.de> wrote:
>
>> Sure, the trace is here  Log.txt
>> <http://qpid.2158936.n2.nabble.com/file/n7636944/Log.txt>
>>
>>  From what I can see in the log, appearantly heartbeats are correctly sent
>> and received by the client.
>> I was assuming that if my client locks in an endless loop no heartbeat
>> signals are addressed. So appearantly there is a detached thread that
>> handles this, right?
>>
>>
> That was my expectation, but I am not familiar with the C++ client - gordon
> can probably confirm.

The qpid::messaging c++ client has a background thread for io (actually 
for 0-10 its a pool of threads shared by connections). So if the 
application/main thread is in an endless loop, heartbeats (and any other 
protocol traffic) can still be received (and responded to).



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


Re: Heartbeating - Java broker

Posted by Rob Godfrey <ro...@gmail.com>.
On 21 January 2016 at 11:37, RatTac@web.de <Ra...@web.de> wrote:

> Sure, the trace is here  Log.txt
> <http://qpid.2158936.n2.nabble.com/file/n7636944/Log.txt>
>
> From what I can see in the log, appearantly heartbeats are correctly sent
> and received by the client.
> I was assuming that if my client locks in an endless loop no heartbeat
> signals are addressed. So appearantly there is a detached thread that
> handles this, right?
>
>
That was my expectation, but I am not familiar with the C++ client - gordon
can probably confirm.


> In my test, heartbeats are only performed if setup as an option in the
> connection api of the client. The setting in the broker does not seem to
> have an effect. So there is no way that the broker can enforce clients to
> have heartbeating enabled? Is it always the sole decision of the client to
> enable it?
>
>
Yes - the AMQP 0-10 protocol leaves it up to the client to decide if
heartbeating should occur or not.  The server first sends the minimum and
maximum frequency of heartbeating it supports, the client then responds
with a parameter between these two values or saying it does not want
heartbeating.

-- Rob


>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Heartbeating-Java-broker-tp7636881p7636944.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Heartbeating - Java broker

Posted by "RatTac@web.de" <Ra...@web.de>.
Sure, the trace is here  Log.txt
<http://qpid.2158936.n2.nabble.com/file/n7636944/Log.txt>  

>From what I can see in the log, appearantly heartbeats are correctly sent
and received by the client.
I was assuming that if my client locks in an endless loop no heartbeat
signals are addressed. So appearantly there is a detached thread that
handles this, right?

In my test, heartbeats are only performed if setup as an option in the
connection api of the client. The setting in the broker does not seem to
have an effect. So there is no way that the broker can enforce clients to
have heartbeating enabled? Is it always the sole decision of the client to
enable it?



--
View this message in context: http://qpid.2158936.n2.nabble.com/Heartbeating-Java-broker-tp7636881p7636944.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: Heartbeating - Java broker

Posted by Rob Godfrey <ro...@gmail.com>.
Can you send a protocol trace?

Thx,
Rob

On 20 January 2016 at 11:03, RatTac@web.de <Ra...@web.de> wrote:

> Hi,
> I'm having a problem to find out how heartbeating exactly works for the
> java
> broker (or how to enable it).
> Via the http management I configured the broker to have a "heartbeat delay"
> of 5s (this was the only option I could find to somehow enable
> heartbeating).
>
> My test client connects also with heartbeat:5 in the connection options.
> After connection the client perform a while(1); to simulate a client crash.
>
> In my understanding the broker should notice after a few seconds that the
> client is not sending a heartbeat back and thus the connection should be
> terminated. However, this is not happening.
>
> Am I missing something, or am I performing the wrong test-scenario to test
> heartbeating?
>
> Regards
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Heartbeating-Java-broker-tp7636881.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>