activemq-classicmqttconsumerspring-integration-mqtt

Can a MQTT Subscriber be able to take concurrently multiple messages of the Same Topic?


I am trying to create a Subscriber in my Spring Boot Application. My objective is that the publisher will send multiple messages to a topic and I have to get those message and process them .I noticed that the "handleMessage" of both Paho and Apache ActiveMq will process 1 message at a time. Is it possible to make it concurrent??

I have tried the following

  1. Replaced Paho with ActiveMq
  2. Provided concurrency in my listenercontainer
  3. Provided prefetch in my subscribe URL

Please let me know if there is any way to make my MQTT subscriber to take multiple messages concurrently.

Thank You


Solution

  • If you supply your own thread pool you can have the handleMessage method pass the incoming message off to the threadpool to process and then pass the next message off to the pool.