Fix setting of client ID to enable to run jboss durable subscriptions

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418900 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-07-04 02:52:46 +00:00
parent c250fa5f6c
commit cf7ee97cf6
2 changed files with 3 additions and 10 deletions

View File

@ -79,6 +79,7 @@ public abstract class AbstractJmsClient {
public Connection getConnection() throws JMSException { public Connection getConnection() throws JMSException {
if (jmsConnection == null) { if (jmsConnection == null) {
jmsConnection = factory.createConnection(); jmsConnection = factory.createConnection();
jmsConnection.setClientID(getClientName());
log.info("Creating JMS Connection: Provider=" + getClient().getJmsProvider() + ", JMS Spec=" + getClient().getJmsVersion()); log.info("Creating JMS Connection: Provider=" + getClient().getJmsProvider() + ", JMS Spec=" + getClient().getJmsVersion());
} }
return jmsConnection; return jmsConnection;

View File

@ -165,14 +165,6 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
} }
} }
public Connection getConnection() throws JMSException {
Connection c = super.getConnection();
if (c.getClientID() == null && client.isDurable()) {
c.setClientID(getClientName());
}
return c;
}
public MessageConsumer createJmsConsumer() throws JMSException { public MessageConsumer createJmsConsumer() throws JMSException {
Destination[] dest = createDestination(destIndex, destCount); Destination[] dest = createDestination(destIndex, destCount);
return createJmsConsumer(dest[0]); return createJmsConsumer(dest[0]);
@ -184,7 +176,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
if (clientName == null) { if (clientName == null) {
clientName = "JmsConsumer"; clientName = "JmsConsumer";
} }
log.info("Creating durable subscriber to: " + dest.toString()); log.info("Creating durable subscriber (" + getConnection().getClientID() + ") to: " + dest.toString());
jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName); jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName);
} else { } else {
log.info("Creating non-durable consumer to: " + dest.toString()); log.info("Creating non-durable consumer to: " + dest.toString());
@ -199,7 +191,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
if (clientName == null) { if (clientName == null) {
clientName = "JmsConsumer"; clientName = "JmsConsumer";
} }
log.info("Creating durable subscriber to: " + dest.toString()); log.info("Creating durable subscriber (" + getConnection().getClientID() + ") to: " + dest.toString());
jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName, selector, noLocal); jmsConsumer = getSession().createDurableSubscriber((Topic) dest, clientName, selector, noLocal);
} else { } else {
log.info("Creating non-durable consumer to: " + dest.toString()); log.info("Creating non-durable consumer to: " + dest.toString());