This commit is contained in:
Clebert Suconic 2018-04-05 13:38:23 -04:00
commit a45d90a8d7
2 changed files with 16 additions and 0 deletions

View File

@ -442,4 +442,9 @@ public interface ActiveMQClientLogger extends BasicLogger {
@Message(id = 214029, value = "Unexpected response from HTTP server: %s")
void unexpectedResponseFromHttpServer(Object response);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 214034, value = "Connection closed: {0} - {1}",
format = Message.Format.MESSAGE_FORMAT)
void connectionClosedWarn(ActiveMQExceptionType type, String message);
}

View File

@ -31,6 +31,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
import org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException;
import org.apache.activemq.artemis.api.core.Message;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ClientConsumer;
@ -1171,6 +1172,11 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
startCall();
try {
sessionContext.xaEnd(xid, flags);
} catch (ActiveMQNotConnectedException ex) {
ActiveMQClientLogger.LOGGER.connectionClosedWarn(ex.getType(), ex.getMessage());
if (logger.isDebugEnabled()) {
logger.debug(ex.getMessage(), ex);
}
} finally {
endCall();
}
@ -1375,6 +1381,11 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
try {
sessionContext.xaRollback(xid, wasStarted);
} catch (ActiveMQNotConnectedException ex) {
ActiveMQClientLogger.LOGGER.connectionClosedWarn(ex.getType(), ex.getMessage());
if (logger.isDebugEnabled()) {
logger.debug(ex.getMessage(), ex);
}
} finally {
if (wasStarted) {
start();