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 {
|
public QueueConnection createQueueConnection() throws JMSException {
|
||||||
Connection con = null;
|
Connection con;
|
||||||
synchronized (this.connectionMonitor) {
|
synchronized (this.connectionMonitor) {
|
||||||
this.pubSubMode = Boolean.FALSE;
|
this.pubSubMode = Boolean.FALSE;
|
||||||
con = createConnection();
|
con = createConnection();
|
||||||
|
|
@ -252,7 +252,7 @@ public class SingleConnectionFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
public TopicConnection createTopicConnection() throws JMSException {
|
public TopicConnection createTopicConnection() throws JMSException {
|
||||||
Connection con = null;
|
Connection con;
|
||||||
synchronized (this.connectionMonitor) {
|
synchronized (this.connectionMonitor) {
|
||||||
this.pubSubMode = Boolean.TRUE;
|
this.pubSubMode = Boolean.TRUE;
|
||||||
con = createConnection();
|
con = createConnection();
|
||||||
|
|
@ -298,6 +298,7 @@ public class SingleConnectionFactory
|
||||||
* Exception listener callback that renews the underlying single Connection.
|
* Exception listener callback that renews the underlying single Connection.
|
||||||
*/
|
*/
|
||||||
public void onException(JMSException ex) {
|
public void onException(JMSException ex) {
|
||||||
|
logger.warn("Encountered a JMSException - resetting the underlying JMS Connection", ex);
|
||||||
resetConnection();
|
resetConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -738,10 +738,10 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
|
||||||
msg.append(getDestinationDescription()).append("' - trying to recover. Cause: ");
|
msg.append(getDestinationDescription()).append("' - trying to recover. Cause: ");
|
||||||
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
|
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.info(msg, ex);
|
logger.warn(msg, ex);
|
||||||
}
|
}
|
||||||
else {
|
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(this.recoveryInterval).append(" ms. Cause: ");
|
||||||
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
|
msg.append(ex instanceof JMSException ? JmsUtils.buildExceptionMessage((JMSException) ex) : ex.getMessage());
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.info(msg, ex);
|
logger.warn(msg, ex);
|
||||||
}
|
}
|
||||||
else if (logger.isInfoEnabled()) {
|
else {
|
||||||
logger.info(msg);
|
logger.warn(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sleepInbetweenRecoveryAttempts();
|
sleepInbetweenRecoveryAttempts();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue