Skip to content

Commit

Permalink
Merge pull request #12497 from SergeTupchiy/EMQX-11825-mongodb-connec…
Browse files Browse the repository at this point in the history
…tor-perf-rel55

mongodb connector perf (release-55)
  • Loading branch information
SergeTupchiy committed Feb 9, 2024
2 parents bda8283 + 8ac8d14 commit 9ec7393
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/emqx_mongodb/rebar.config
Expand Up @@ -4,5 +4,5 @@
{deps, [
{emqx_connector, {path, "../../apps/emqx_connector"}},
{emqx_resource, {path, "../../apps/emqx_resource"}},
{mongodb, {git, "https://github.com/emqx/mongodb-erlang", {tag, "v3.0.22"}}}
{mongodb, {git, "https://github.com/emqx/mongodb-erlang", {tag, "v3.0.23"}}}
]}.
2 changes: 1 addition & 1 deletion apps/emqx_mongodb/src/emqx_mongodb.app.src
@@ -1,6 +1,6 @@
{application, emqx_mongodb, [
{description, "EMQX MongoDB Connector"},
{vsn, "0.1.5"},
{vsn, "0.1.6"},
{registered, []},
{applications, [
kernel,
Expand Down
22 changes: 3 additions & 19 deletions apps/emqx_mongodb/src/emqx_mongodb.erl
Expand Up @@ -131,8 +131,8 @@ fields(topology) ->
hoconsc:mk(
pos_integer(),
#{
deprecated => {since, "5.1.1"},
importance => ?IMPORTANCE_HIDDEN
importance => ?IMPORTANCE_HIDDEN,
default => 10
}
)},
{max_overflow, fun max_overflow/1},
Expand Down Expand Up @@ -201,23 +201,7 @@ on_start(
false ->
[{ssl, false}]
end,
Topology0 = maps:get(topology, NConfig, #{}),
%% we fix this at 1 because we already have ecpool
case maps:get(pool_size, Topology0, 1) =:= 1 of
true ->
ok;
false ->
?SLOG(
info,
#{
msg => "mongodb_overriding_topology_pool_size",
connector => InstId,
reason => "this option is deprecated; please set `pool_size' for the connector",
value => 1
}
)
end,
Topology = Topology0#{pool_size => 1},
Topology = maps:get(topology, NConfig, #{}),
Opts = [
{mongo_type, init_type(NConfig)},
{hosts, Hosts},
Expand Down
3 changes: 3 additions & 0 deletions changes/ee/perf-12497.en.md
@@ -0,0 +1,3 @@
Improve MongoDB connector performance.

- [mongodb-erlang PR](https://github.com/emqx/mongodb-erlang/pull/41)

0 comments on commit 9ec7393

Please sign in to comment.