emqx/apps/emqx_resource
Thales Macedo Garitezi 0b6fd7fe14 fix(buffer_worker): check request timeout and health check interval
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.
2023-04-04 08:58:36 -03:00
..
i18n fix(buffer_worker): check request timeout and health check interval 2023-04-04 08:58:36 -03:00
include refactor: rename test resource prefix 2023-03-16 13:43:01 -03:00
src fix(buffer_worker): check request timeout and health check interval 2023-04-04 08:58:36 -03:00
test Merge pull request #10128 from thalesmg/ocsp-v50-mkII 2023-03-16 13:10:48 -03:00
README.md feat: add test cases for batching query 2022-08-10 00:34:35 +08:00
rebar.config fix: drop no longer supported dialyzer option 2022-12-16 13:45:05 +03:00

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 minimal emqx_resource implementation;
  • test/emqx_resource_SUITE.erl for examples of emqx_resource usage.