# Delayed publish

The delay-publish function of EMQX Broker can implement the function of delaying the PUBLISH packet publishing according to the time interval configured by the user. When a client publishes a message to EMQX Broker with the special topic prefix $delayed/{DelayInteval} , the delay-publish function is triggered.

The specific format of the delay-publish topic is as follows:

  • $delayed: Messages prefixed with $delayed will be treated as messages that need to be delayed. The delay interval is determined by the content of the next topic level.
  • {DelayInterval}: Specify the time interval for delaying the publish of this MQTT message with the unit of second. The maximum allowed interval is 4294967 seconds. If {DelayInterval} cannot be parsed as an integer number, EMQX Broker will discard the message and the client will not receive any information.
  • {TopicName}: The topic name of the MQTT message.


  • $delayed/15/x/y: Publish MQTT message to the topic x/y after 15 seconds
  • $delayed/60/a/b: Publish MQTT message to the topic a/b after 1 minute
  • $delayed/3600/$SYS/topic: Publish MQTT message to the topic $SYS/topic after 1 hour

This feature is provided by the emqx-delay-publish plugin, which is disabled by default. You need to enable the plugin to use this feature. For the method of enabling the plugin, please refer to Plugins. If you need to use this feature for a long time, then it is recommended that you set the plugin to start by default, see directory structure for more information.