Close the consumer before unsubscribing it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@420775 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-07-11 09:42:16 +00:00
parent d1ff5abf48
commit 43742775af
1 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
} finally { } finally {
if (client.isDurable() && client.isUnsubscribe()) { if (client.isDurable() && client.isUnsubscribe()) {
log.info("Unsubscribing durable subscriber: " + getClientName()); log.info("Unsubscribing durable subscriber: " + getClientName());
getJmsConsumer().close();
getSession().unsubscribe(getClientName()); getSession().unsubscribe(getClientName());
} }
getConnection().close(); getConnection().close();
@ -114,6 +115,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
} finally { } finally {
if (client.isDurable() && client.isUnsubscribe()) { if (client.isDurable() && client.isUnsubscribe()) {
log.info("Unsubscribing durable subscriber: " + getClientName()); log.info("Unsubscribing durable subscriber: " + getClientName());
getJmsConsumer().close();
getSession().unsubscribe(getClientName()); getSession().unsubscribe(getClientName());
} }
getConnection().close(); getConnection().close();
@ -142,6 +144,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
} finally { } finally {
if (client.isDurable() && client.isUnsubscribe()) { if (client.isDurable() && client.isUnsubscribe()) {
log.info("Unsubscribing durable subscriber: " + getClientName()); log.info("Unsubscribing durable subscriber: " + getClientName());
getJmsConsumer().close();
getSession().unsubscribe(getClientName()); getSession().unsubscribe(getClientName());
} }
getConnection().close(); getConnection().close();
@ -175,6 +178,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
} finally { } finally {
if (client.isDurable() && client.isUnsubscribe()) { if (client.isDurable() && client.isUnsubscribe()) {
log.info("Unsubscribing durable subscriber: " + getClientName()); log.info("Unsubscribing durable subscriber: " + getClientName());
getJmsConsumer().close();
getSession().unsubscribe(getClientName()); getSession().unsubscribe(getClientName());
} }
getConnection().close(); getConnection().close();