How can onException be triggered if the client is dead?
If you mean you killed the network, an exception will be triggered when it
tries to ping the server (once every minute in the default configuration).
There is a read timeout parameter so that the server can detect the client
Thanks for your reply. Now I understan how it works.
"There is a read timeout parameter so that the server can detect the client
I have another question, then:
I kill my client but when the 60 seconds of detection complete, the server does not detect the client. Even if I leave it for some minutes...
So I reduced the PingPeriod to 200 and the ReadTimeout to 800. Whis this numbers it does work, but (I don't know why) I leave the client connected doing nothing, and it also detects the client disconnection, when the client is connected.
Do I need to implement my own ping message every xxxx miliseconds and send it as a JMS message?
Why would it work with a read timeout of 800 millis-seconds but not 70 seconds?
You've got something strange going on.
I didn't change anything in the client. Just changed the server configuration.
Maybe I've got to change the client ping and read timeout?
In the case, where (what files or properties)?
I forgot to mention that I notice the disconnection using an onExceptionMessage on a class that implements the ExceptionListener interface, and is suscribed to the connection.
I don't understand the question.
The configuration is on the server. The client pings otherwise the server timesout.
Does it make sense that the server never respects the specified read timeout?
Do you have any single idea about what might be?
Please can anybody help me?
This is really urgent and I've been trying to solve it for three days.
First, how do you know the server still thinks the client is connected?
Have you looked at debug/trace messages to see whether the server
is quietly detecting the failure?
If the read timeout is not working, it is a problem with your network,
tcp/ip stack or virtual machine. i.e. a bug
Didn't you mention it works with a small timeout but not with a large timeout?
>First, how do you know the server still thinks the client is connected?
>Have you looked at debug/trace messages to see whether the server
>is quietly detecting the failure?
I debugged the server using the JBossIDE in eclipse, looking the onException method. Its not called at all. Should I debug something else?
>If the read timeout is not working, it is a problem with your network,
>tcp/ip stack or virtual machine. i.e. a bug
>Didn't you mention it works with a small timeout but not with a large timeout?
It didn't work fine. I think the timeout was so small, that a connected client couldn't make it to send a ping, so the server "disconnected" it. Funny, with 600 ms it doesn't work either, that being fast enough.
Any other suggestions? Just don't know what to do.
I've discovered that my JBoss at startup logs this message:
11:49:22,610 INFO [SnmpAgentService] Starting heartbeat controller ...
11:49:22,610 WARN [Heartbeat] Heartbeat disabled
Does this have anuthing to do with the client detection?
How can I fix this to enable the Heartbeat Service?
You have completely confused me. I don't think you have read what I'm telling you.
onException is invoked when the client loses the connection to the server.
It is likely to be invoked when the client tries to ping the server and it fails.
The detection by the server of the client going away will not invoke onException on the
How can it, it has lost the connection to the client.
One of your queries was about the client crashing. It cannot invoke onException
after a crash. The program is no more.
First, I've read your posts.
Second, I have two onException methods:
1) In the client, to detect server crashes.
2) In the server, to detect client crashes or disconnection.
I Don't expect the server to invoke a client's onException (as you said the client has crashed!)
I Expect the server detecting a client crash in its own (server) onException.
Here are the steps I follow on the server.
1) Receive a TemporaryQueueConnection from the client
2) Get a reference to the connection and set an exceptionListener that is on the server.
3) Kill the client once it is connected
4) Expect the server to invoke its own onException.
I hope this is not bothering you.