You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to automatically inferring field types, the prepared statement technology also prevents SQL injection to enhance security.
182
182
183
+
### Fallback Actions
184
+
185
+
Since EMQX 5.9.0, for a given Action, it's possible to define a set of Actions that will be triggered if processing of a message fails for whatever reason. Such set of Actions is called Fallback Actions. With Fallback Actions, it's possible to send data to secondary Sinks, reducing the probability of data loss, and may also serve to help observability of problems.
186
+
187
+
A few key facts about Fallback Actions:
188
+
189
+
- They are triggered whenever the primary Action fails or drops the message (due to buffer overflow or request TTL being reached).
190
+
- They are always triggered in Async Query Mode, regardless of their configuration.
191
+
- All configured Fallback Actions of a primary Action are triggered (i.e., we don't try one-by-one and stop at the first success).
192
+
- Fallback Actions use the same buffering layer as all other actions, meaning that messages will be retried up to their request TTL or if there's buffer overflow.
193
+
- Fallback Actions do **not** trigger further Fallback Actions: if a message being processed by a Fallback Action fails with an unrecoverable error or is dropped, no further Actions are triggered, even if there are other Fallback Actions configured.
194
+
- Processing of messages by Fallback Actions do not affect metrics of their Primary Actions or of the original Rule that triggered the Primary Action.
195
+
196
+
#### Defining a Fallback Action
197
+
198
+
Let's say, for example, we want to configure some Fallback Actions for our HTTP Action called `my_http`. Let's also assume there exists an MQTT Action called `fallback` already configured.
199
+
200
+
In that case, we may simply define the following configuration:
201
+
202
+
```hcl
203
+
actions {
204
+
http {
205
+
my_http {
206
+
fallback_actions = [
207
+
{kind = reference, type = mqtt, name = fallback},
208
+
{
209
+
kind = republish,
210
+
args = {
211
+
topic = "fallback/republish/topic"
212
+
qos = 1
213
+
payload = "${payload}"
214
+
}
215
+
}
216
+
]
217
+
}
218
+
}
219
+
mqtt {
220
+
fallback {
221
+
fallback_actions = [
222
+
{kind = reference, type = mqtt, name = another_fallback}
223
+
]
224
+
}
225
+
}
226
+
}
227
+
```
228
+
229
+
In the example above, if a message fails to be processed by `my_http`, then we will forward the same message to the `fallback` MQTT Action, and also republish the original message according to the parameters above. If the message then fails to be processed by `fallback`, even though there is a Fallback Action `another_fallback` configured for `fallback`, the message will **not** be further forwarded to `another_fallback`. If `fallback` were to receive a message itself as a Primary Action, then `another_fallback` could be triggered on processing failures.
230
+
183
231
## Sink Status and Statistics
184
232
185
233
You can view the running status and statistics of a Sink on the Dashboard to know if the Sink is operating properly.
@@ -220,7 +268,7 @@ The `success` statistic counts the number of messages that were successfully rec
220
268
221
269
The `failed` statistic counts the number of messages that failed to be received by the external data system. `retried.failed` is a sub-count of `failed` which tracks the number of messages with delivery retried at least once. Therefore, `retried.failed <= failed`.
222
270
223
-
#### Dropped
271
+
#### Dropped
224
272
225
273
The `dropped` statistic counts the number of messages that were dropped without any delivery attempt. It contains several more specific categories, each indicating a distinct reason for the drop. The calculation for `dropped` is:`dropped = dropped.expired + dropped.queue_full + dropped.resource_stopped + dropped.resource_not_found`.
0 commit comments