I have a simple JmsListener that is listening to messages published to an ActiveMQ classic queue
@JmsListener(destination = "ReportScheduleQueue")
public void receiveMessage(String message) {
log.info("Received message - {}", message);
}
@Scheduled(cron = "0 */1 * ? * *")
public void sendMessage() {
jmsTemplate.convertAndSend("ReportScheduleQueue", "test message sent at " + new Date());
}
After a couple of message were triggered, I notice that the publish count is 2 but the process count is 4
"jms.message.process.error.none.exception.none.messaging.destination.name.ReportScheduleQueue.count": "4",
"jms.message.publish.error.none.exception.none.messaging.destination.name.ReportScheduleQueue.count": "2"
Looks like both AbstractPollingMessageListenerContainer and AbstractMessageListenerContainer are recording the observation and since AbstractPollingMessageListenerContainer extends AbstractMessageListenerContainer , we end up reporting the process count twice.
Comment From: bclozel
Please provide a minimal sample application
Comment From: sgnanask
Have modified gs-messaging-jms/complete project mentioned in https://spring.io/guides/gs/messaging-jms sample to reproduce the problem complete.tar.gz
Comment From: bclozel
Thanks for the repro @sgnanask , this will be fixed with our next maintenance releases.