refined logging in JMS SingleConnectionFactory and DefaultMessageListenerContainer
This commit is contained in:
parent
5c2d63745f
commit
5a55b8384a
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue