# Republish Action
The republish action is used to reissue a new MQTT message. The
Payload of the new message can be specified by parameters.
Note that the message republish action does not terminate the delivery of the original messages. For example, if a message "t/1" is received by the republish action and then a new "t/2" message is published per this rule, the delivery of the "t/1" message is not terminated, and clients subscribed to the "t/1" topic can still receive the original message.
# Create Rule
Click on Rules Engine - Rules - Create, and enter SQL.
SELECT * FROM "t/1"
# Create Action
Click Add Action, select Data Forwarding, Message Redistribution, enter the destination subject and other parameters, and refer to the following table for parameter definitions.
|Target Topic||The topic of the ||String|
|Target QoS||The QoS level of the ||Integer or placeholder variable|
|Target Retain||The Retain message identifier of the ||Boolean or placeholder variable|
|Payload Template||The message content of the ||String|
Note that when the QoS and Retain use placeholder variables and the parameters obtained from the message information are not legal (i.e. QoS is not 0, 1 or 2, Retain is not true or false), the message is discarded and the action is marked as failed.
Using the desktop MQTT client MQTTX, set the clientid to
123456, connect to the device and subscribe to
Post a message and you can see that client received a message with topic