refined logging in JMS SingleConnectionFactory and DefaultMessageListenerContainer

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1762 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-08-26 12:01:51 +00:00
parent 4c33a86340
commit 59a7206236
2 changed files with 8 additions and 7 deletions
@@ -234,7 +234,7 @@ public class SingleConnectionFactory
}
public QueueConnection createQueueConnection() throws JMSException {
Connection con = null;
Connection con;
synchronized (this.connectionMonitor) {
this.pubSubMode = Boolean.FALSE;
con = createConnection();
@@ -252,7 +252,7 @@ public class SingleConnectionFactory
}
public TopicConnection createTopicConnection() throws JMSException {
Connection con = null;
Connection con;
synchronized (this.connectionMonitor) {
this.pubSubMode = Boolean.TRUE;
con = createConnection();
@@ -298,6 +298,7 @@ public class SingleConnectionFactory
* Exception listener callback that renews the underlying single Connection.
*/
public void onException(JMSException ex) {
logger.warn("Encountered a JMSException - resetting the underlying JMS Connection", ex);
resetConnection();
}
@@ -738,10 +738,10 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
msg.append(getDestinationDescription()).append("' - trying to recover. Cause: ");
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
if (logger.isDebugEnabled()) {
logger.info(msg, ex);
logger.warn(msg, ex);
}
else {
logger.info(msg);
logger.warn(msg);
}
}
}
@@ -792,10 +792,10 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
msg.append(this.recoveryInterval).append(" ms. Cause: ");
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
if (logger.isDebugEnabled()) {
logger.info(msg, ex);
logger.warn(msg, ex);
}
else if (logger.isInfoEnabled()) {
logger.info(msg);
else {
logger.warn(msg);
}
}
sleepInbetweenRecoveryAttempts();