https://issues.apache.org/jira/browse/AMQ-3499 - increase transport failure to warn and exclude eof for stomp

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1170624 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2011-09-14 13:49:25 +00:00
parent 5cf4ada14a
commit 8abb5b6df1
1 changed files with 5 additions and 3 deletions

View File

@ -16,6 +16,7 @@
*/
package org.apache.activemq.broker;
import java.io.EOFException;
import java.io.IOException;
import java.net.SocketException;
import java.net.URI;
@ -229,15 +230,16 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
transportException.set(e);
if (TRANSPORTLOG.isDebugEnabled()) {
TRANSPORTLOG.debug("Transport failed: " + e, e);
} else if (TRANSPORTLOG.isInfoEnabled() && !expected(e)) {
TRANSPORTLOG.info("Transport failed: " + e);
} else if (TRANSPORTLOG.isWarnEnabled() && !expected(e)) {
TRANSPORTLOG.warn("Transport failed: " + e);
}
stopAsync();
}
}
private boolean expected(IOException e) {
return e instanceof SocketException && isStomp() && e.getMessage().indexOf("reset") != -1;
return isStomp() &&
((e instanceof SocketException && e.getMessage().indexOf("reset") != -1) || e instanceof EOFException);
}
private boolean isStomp() {