From 6355225b133d3eded826077b6071931615612e24 Mon Sep 17 00:00:00 2001 From: "Adrian T. Co" Date: Thu, 15 Jun 2006 08:13:18 +0000 Subject: [PATCH] Set the clientID of the connection for durable subscribers. git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@414502 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/tool/JmsConsumerClient.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java b/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java index 465012e76d..09439b02a6 100644 --- a/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java +++ b/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java @@ -21,9 +21,16 @@ import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.jms.*; import java.util.Properties; +import javax.jms.Connection; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.Topic; + public class JmsConsumerClient extends JmsPerformanceSupport { private static final Log log = LogFactory.getLog(JmsConsumerClient.class); @@ -142,7 +149,15 @@ public class JmsConsumerClient extends JmsPerformanceSupport { } } } - + + public Connection getConnection() throws JMSException { + Connection c = super.getConnection(); + if (c.getClientID() == null && isDurable()) { + c.setClientID(getClientName()); + } + return c; + } + public MessageConsumer createJmsConsumer() throws JMSException { Destination[] dest = createDestination(); return createJmsConsumer(dest[0]);