![]() Port of https://github.com/emqx/emqx/pull/10154 for `release-50` Fixes https://emqx.atlassian.net/browse/EMQX-9099 Originally, the `resume_interval`, which is what defines how often a buffer worker will attempt to retry its inflight window, was set to the same as the `health_check_interval`. This had the problem that, with default values, `health_check_interval = request_timeout`. This meant that, if a buffer worker with those configs were ever blocked, all requests would have timed out by the time it retried them. Here we change the default `resume_interval` to a reasonable value dependent on `health_check_interval` and `request_timeout`, and also expose that as a hidden parameter for fine tuning if necessary. |
||
---|---|---|
.. | ||
i18n | ||
include | ||
src | ||
test | ||
README.md | ||
rebar.config |
README.md
emqx_resource
The emqx_resource
is a behavior that manages configuration specs and runtime states
for resources like mysql or redis backends.
It is intended to be used by the emqx_bridges and all other resources that need CRUD operations to their configs, and need to initialize the states when creating.
There can be foreign references between resource instances via resource-id. So they may find each other via this Id.
The main idea of the emqx resource is to put all the general
code in a common lib, including
the config operations (like config validation, config dump back to files), and the state management.
And we put all the specific
codes to the callback modules.
See
test/emqx_connector_demo.erl
for a minimalemqx_resource
implementation;test/emqx_resource_SUITE.erl
for examples ofemqx_resource
usage.