An error occurred while sending a message to the TOPIC

0Shares

When you use Microsoft Service Bus connector in Mule projects, you’ll often see this error: “The MessageProducer was closed due to an unrecoverable error.” and “Error type: SERVICEBUS:PUBLISHING“.

This error occurs for “Topic Send” for Microsoft Windows Service Bus connector. This error indicates that Azure Service Bus has closed the producer since the producer has not published for longer time i.e. it is idle for longer time and closed the connection within the timeout timespan.

These producers will be cached by default and when the mule flow publishes a message, we will get the mentioned error. It might recover in few minutes to hours and its unpredictable.

Figure 1 – Default settings

Solution to fix this issue:

Disable the setting “Cache producers” by unchecking the box and it fixes the issue.

Figure 2 – Disable Cache producers

Hope this helps! If you see any issues, please post in the comments and we can work together in understanding and fixing the issues.

0Shares