mirror of https://github.com/apache/activemq.git
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:
parent
c250fa5f6c
commit
cf7ee97cf6
|
@ -79,6 +79,7 @@ public abstract class AbstractJmsClient {
|
|||
public Connection getConnection() throws JMSException {
|
||||
if (jmsConnection == null) {
|
||||
jmsConnection = factory.createConnection();
|
||||
jmsConnection.setClientID(getClientName());
|
||||
log.info("Creating JMS Connection: Provider=" + getClient().getJmsProvider() + ", JMS Spec=" + getClient().getJmsVersion());
|
||||
}
|
||||
return jmsConnection;
|
||||
|
|
|
@ -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 {
|
||||
Destination[] dest = createDestination(destIndex, destCount);
|
||||
return createJmsConsumer(dest[0]);
|
||||
|
@ -184,7 +176,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
|
|||
if (clientName == null) {
|
||||
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);
|
||||
} else {
|
||||
log.info("Creating non-durable consumer to: " + dest.toString());
|
||||
|
@ -199,7 +191,7 @@ public class JmsConsumerClient extends AbstractJmsMeasurableClient {
|
|||
if (clientName == null) {
|
||||
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);
|
||||
} else {
|
||||
log.info("Creating non-durable consumer to: " + dest.toString());
|
||||
|
|
Loading…
Reference in New Issue