Hello ,
This is regarding JMS usage where an HTTP flow was used as a message source and post it message gets logged via set payload and then it goes to JMS processor where Topic is being set . Now post Topic set another flow in jms.xml is being called which was used to send message from http://mu.mulesoft-training.com/jms/ link.
When i debug this i saw that message when goes out of JMS outbound endpoint , simultaneously the message was picked by JMS inbound Flow which is actually subscribed to apiessentials topic flow does not terminates instead the same message was picked at-least 8 times by other the JMS inbound flow subscribed to apiessential topic. Please find below logs :
WARN 2017-06-03 17:27:49,768 [[apdev-example].HTTP_Listener_Configuration.worker.01] com.mulesoft.mule.transport.jms.EeJmsMessageDispatcher: Starting patched JmsMessageReceiver
INFO 2017-06-03 17:27:49,769 [[apdev-example].HTTP_Listener_Configuration.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Active_MQ.dispatcher.497819'. Object is: EeJmsMessageDispatcher
INFO 2017-06-03 17:27:49,770 [[apdev-example].HTTP_Listener_Configuration.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Active_MQ.dispatcher.497819'. Object is: EeJmsMessageDispatcher
INFO 2017-06-03 17:27:49,858 [[apdev-example].getTopicMessagesFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:10,409 [[apdev-example].getTopicMessagesFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:14,861 [[apdev-example].getTopicMessagesFlow.stage1.03] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:17,757 [[apdev-example].getTopicMessagesFlow.stage1.04] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:17,758 [[apdev-example].getTopicMessagesFlow.stage1.05] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:19,535 [[apdev-example].getTopicMessagesFlow.stage1.06] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:20,444 [[apdev-example].getTopicMessagesFlow.stage1.07] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:21,347 [[apdev-example].getTopicMessagesFlow.stage1.08] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
INFO 2017-06-03 17:33:22,156 [[apdev-example].getTopicMessagesFlow.stage1.04] org.mule.api.processor.LoggerMessageProcessor: Message Logged in JMS Flow
I would like to understand why does it happens. As per my understanding once message is available for any topic and the subscriber has consumed it once then same message should not have been picked again. Please find attached project xml catalog export for reference.apdev-example-2.zip
Sorry for buttin' in, but I've found your explanation may confuse both terms.
Queues are about point-to-point messaging. A producer puts (write) a message in some queue, and some consumer gets (read) that message. Standard behavior is that a message is removed upon successful reading, so avoiding duplicate processing. Multiple consumers could read the same queue, and they'll never should got the same message. No duplicates.
Topics are a special kind of destination, where a publisher puts a message. Unlike queues -where you have to know who to send the message (think SMS)- the publisher doesn't need to know who his/her subscribers are.
Every subscriber would read his/her copy of the published message only once. The published message would removed from the topic when each and every subscriber has got it. Eventually, two or more copies of the published message could be processed by several subscribers leading to a duplication problem.
Queues = producers and consumers
Topics = publishers and subscribers
HTH!