From dd4899e2bac7d7fc6b2486b9c89a1bdde7ea7cea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Thu, 20 Jan 2011 16:49:00 +0000 Subject: [PATCH] msg broker reconnect fixes --- org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp b/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp index 67fd77e..7e788c7 100644 --- a/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp +++ b/org.glite.lb.logger-msg/src/activemq_cpp_plugin.cpp @@ -97,6 +97,7 @@ OutputPlugin::connect(const std::string &topic) current_connection->start(); releaseConnection(); } catch (cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "OutputPlugin::connect exception: %s", e.what()); releaseConnection(); cleanup(); throw e; @@ -222,11 +223,23 @@ OutputPlugin::close() void OutputPlugin::cleanup() { - close(); + try { + close(); + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: close exception: %s", e.what()); + } pthread_rwlock_wrlock(&connection_lock); if(connection && current_connection == connection) { - connection->close(); - delete connection; + try { + connection->close(); + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: connection close exception: %s", e.what()); + } + try { + delete connection; + } catch(cms::CMSException &e) { + glite_common_log(IL_LOG_CATEGORY, LOG_PRIORITY_DEBUG, "activemq_cpp_plugin: cleanup exception: %s", e.what()); + } connection = NULL; current_connection = NULL; } -- 1.8.2.3