Connection connection; Destination queue; Consumer consumer; ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://<hostname>:61616"); connection = connectionFactory.createConnection(); connection.start(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); consumer = session.createConsumer(queue); consumer.setMessageListener(messageListener);
While creating connection to connectionfactory, it creates a new connection with my localhostname. But i do not want that in my case. As i have already have a connection created. Is there is a way to use the existing connection instead of creating a new connection. In my case the given destination have two connections(one which already exists and the second one created during the test run) so the messages are distributed between the two connections and i could not able to retrieve the exact consumed messages count. -- View this message in context: http://activemq.2283324.n4.nabble.com/Unable-to-consume-all-messages-from-the-existing-connection-tp4707311p4707385.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.