activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanumath <grand...@infratab.in>
Subject What are the uses of Durable Subscribers
Date Mon, 16 Sep 2013 07:09:44 GMT
Hi All,

   we have 10 messages in Activemq and 2 consumers. consumers starting to
consume and processing messages If I trigger consumers corresponding links
at initial time.For this I wrote the following code

*ActiveMQConnectionFactory connectionFactory=new
ActiveMQConnectionFactory("admin","admin","tcp://localhost:61617?jms.prefetchPolicy.queuePrefetch=1");
Connection connection=connectionFactory.createConnection();
final Session session=connection.createSession(true,
Session.CLIENT_ACKNOWLEDGE);
Queue queue=session.createQueue("ThermalMap");
javax.jms.MessageConsumer consumer=session.createConsumer(queue);
//anonymous class
MessageListener listener = new MessageListener() {
		@Override
		public void onMessage(Message msg) {
                 // My business code
                }
};
*


I deployed this entire Application in *Apache Tomcat*.

Now, Consumers continuously consuming messages If any client sends message
to Activemq. so far it's fine.

Later If I want to stop consuming messages by consumers without stoping
*webserver(Apache Tomcat)*.

How can I achieve this.

Thanks.



--
View this message in context: http://activemq.2283324.n4.nabble.com/What-are-the-uses-of-Durable-Subscribers-tp4671512.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message