activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RJtokenlanring <ing.marco.colo...@gmail.com>
Subject Re: Set ClientID - InvalidClientIDException
Date Fri, 16 Jul 2010 09:56:21 GMT

//CODE
public class TestVaseClientID {

	public static void main(String[] args) {
		try {
			ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("user", "default", "http://192.168.100.88:61617");
			Connection connection = connectionFactory.createConnection();
			String clid = "myclid";
			connection.setClientID(clid);
			connection.start();
			
			// Create the session
			Session msess = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
			Topic destination = msess.createTopic("topic/myDurableTopic");
			
			TopicSubscriber tsub = msess.createDurableSubscriber((Topic)destination,
clid, "(InputSel = '10')", false);
			while(true){
				System.out.println("Receiving....");
				tsub.receive(10000);
			}
		} catch (JMSException e) {
			e.printStackTrace();
		}

	}
}

//RECONNECTION ERROR
javax.jms.InvalidClientIDException: Broker: localhost - Client: myclid
already connected from blockingQueue_20984287
	at
org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:216)
	at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
	at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
	at
org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:77)
	at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
-- 
View this message in context: http://old.nabble.com/Set-ClientID---InvalidClientIDException-tp29172904p29181951.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message