Improve performance of federation

When a federated message is processed, certain headers are added,
cluster_name is called for every message.
This every single time creates an UDP port and queries into the
inet_drv to get the hostname.
Now we first try to look it up in the database instead of
calculating a default which will not be needed.
This commit is contained in:
Lajos Gerecs 2021-06-04 13:13:35 +02:00
parent e506e24a2d
commit f17a97082c
1 changed files with 4 additions and 2 deletions

View File

@ -73,8 +73,10 @@ is_process_running(Node, Process) ->
-spec cluster_name() -> binary().
cluster_name() ->
rabbit_runtime_parameters:value_global(
cluster_name, cluster_name_default()).
case rabbit_runtime_parameters:value_global(cluster_name) of
not_found -> cluster_name_default();
Name -> Name
end.
cluster_name_default() ->
{ID, _} = parts(node()),