Yes, message deletion results from message acknowledgement, so if you're seeing messages getting deleted at the rate they're consumed, then your acknowledgements are working.
Tim On Jul 13, 2017 7:14 AM, "Abhijit Kangale" <[email protected]> wrote: > Hi, > > In my project I have below functionality - > > 1)'datapump-messaging' module (Producer) writes messages to acitveMQ in > queue (this module will create queue if already not present based on > configuration). > 2) 'datapump-services' module (Consumer) reads messages from the queue > (created in step 1). > > In my consumer module I am using JMSTemplete to read the message from the > queue. I am specifically using execute method of JmsTemplete to read the > message. Code snippet below. > > Object message = companyQueueJmsTemplate.execute(new > SessionCallback() > { > Object result = null; > > @Override > public Object doInJms(Session session) throws JMSException > { > MessageConsumer consumer = session > > .createConsumer(companyQueueJmsTemplate.getDestinationResolver(). > resolveDestinationName(session, > queueName, false)); > > try > { > Message received = consumer.receive(5000); > if (received != null) > { > result = > companyQueueJmsTemplate.getMessageConverter().fromMessage(received); > > received.acknowledge(); > } > } > catch (Exception e) > { > logger.error("Error occurred pulling Message from > Queue", e.getMessage()); > } > finally > { > consumer.close(); > } > return result; > } > }, true); > > Additionally while configuring JmsTemplete bean I have set > 'CLIENT_ACKNOWLEDGE' mode. > > jmsTemplate.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE); > > As I am acknowledging using "received.acknowledge();", code works > perfectly, > but the question is where in ActiveMQ web console to verify that message is > delivered and read by consumer properly? Do we have any such provision in > console to verify, because as my consumer reads message it gets deleted > from > the queue? > > Thanks. > > > > -- > View this message in context: http://activemq.2283324.n4. > nabble.com/Where-to-see-acknowledgement-in-ActiveMQ- > Web-console-tp4728515.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >
