0

I have configured a MQTT subscriber in spring using spring mqtt integration. In the handleMessage method I am doing certain business logic which takes time. While testing I noticed that when I am sending bulk number of messages the Broker republishes the same message as an original message (I checked whether the Message payload is duplicate , it was sending as original). The MQTT Broker is publishing the message again even before the Subscriber can send PUCOMP. QOS level is set to 2

prashant s
  • 148
  • 1
  • 1
  • 9

1 Answers1

0

You should not be doing long running tasks in the handleMessage callback as this is run on the MQTT Clients network thread.

If you have a long running task you should be handing it off to a separate thread pool to run.

hardillb
  • 54,545
  • 11
  • 67
  • 105