feat: change message retry_interval default value to infinity

Previous Setting: The default value for `retry_interval` was 30 seconds.

New Default: The default `retry_interval` has been changed to 'infinity'.
With this update, EMQX will not automatically retry message deliveries
by default.

Compliance and Compatibility: Aligning with MQTT specification
standards, in-session message delivery retries are not typically
compliant. We recognize that some users depend on this feature, so the
option to configure retries remains available for backward
compatibility.
This commit is contained in:
zmstone 2024-05-21 09:49:54 +02:00
parent b232784df2
commit 20c92407c7
3 changed files with 13 additions and 5 deletions

View File

@ -3630,9 +3630,9 @@ mqtt_general() ->
)},
{"retry_interval",
sc(
duration(),
hoconsc:union([infinity, duration()]),
#{
default => <<"30s">>,
default => infinity,
desc => ?DESC(mqtt_retry_interval)
}
)},

View File

@ -602,9 +602,9 @@ handle_timeout(ClientInfo, expire_awaiting_rel, Session) ->
%%--------------------------------------------------------------------
-spec retry(clientinfo(), session()) ->
{ok, replies(), session()}.
retry(ClientInfo, Session = #session{inflight = Inflight}) ->
case emqx_inflight:is_empty(Inflight) of
{ok, replies(), session()} | {ok, replies(), timeout(), session()}.
retry(ClientInfo, Session = #session{inflight = Inflight, retry_interval = Interval}) ->
case emqx_inflight:is_empty(Inflight) orelse Interval =:= infinity of
true ->
{ok, [], Session};
false ->

View File

@ -0,0 +1,8 @@
Change `mqtt.retry_interval` config default to `infinity`.
Previously, the default value for `retry_interval` was 30 seconds.
The new default has been changed to 'infinity'. With this update, EMQX will not automatically retry message deliveries by default.
Aligning with MQTT specification standards, in-session message delivery retries are not typically compliant.
We recognize that some users depend on this feature, so the option to configure retries remains available for backward compatibility.