activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r414502 - /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
Date Thu, 15 Jun 2006 08:13:18 GMT
Author: aco
Date: Thu Jun 15 01:13:18 2006
New Revision: 414502

URL: http://svn.apache.org/viewvc?rev=414502&view=rev
Log:
Set the clientID of the connection for durable subscribers.

Modified:
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java?rev=414502&r1=414501&r2=414502&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
Thu Jun 15 01:13:18 2006
@@ -21,9 +21,16 @@
 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 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]);



Mime
View raw message