From 9c1a735b82c4e8259176757ecd52495f6711ecfd Mon Sep 17 00:00:00 2001 From: lazedo Date: Tue, 27 Aug 2019 10:24:26 +0000 Subject: [PATCH] add amqp dist (#5994) * for now, it will not start by default. this may change --- core/kazoo_amqp/src/kz_amqp_connections.erl | 5 +++++ make/deps.mk | 6 +++++- rel/dev.relx.config.script | 1 - rel/kazoo | 4 +++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/kazoo_amqp/src/kz_amqp_connections.erl b/core/kazoo_amqp/src/kz_amqp_connections.erl index 7f5a47a916d..6d125c85a99 100644 --- a/core/kazoo_amqp/src/kz_amqp_connections.erl +++ b/core/kazoo_amqp/src/kz_amqp_connections.erl @@ -35,6 +35,7 @@ -export([brokers_for_zone/1, brokers_for_zone/2, broker_for_zone/1]). -export([brokers_with_tag/1, brokers_with_tag/2, broker_with_tag/1]). -export([is_zone_available/1, is_tag_available/1, is_hidden_broker/1]). +-export([uris/0]). -export([start_link/0]). @@ -508,3 +509,7 @@ is_tag_available(Tag) -> broker_with_tag(Tag) =/= 'undefined'. -spec is_hidden_broker(list()) -> boolean(). is_hidden_broker(Tags) -> lists:member(?AMQP_HIDDEN_TAG, Tags). + +-spec uris() -> kz_term:ne_binaries(). +uris() -> + lists:usort([Broker || #kz_amqp_connections{broker=Broker, tags=Tags} <- ets:tab2list(?TAB), not is_hidden_broker(Tags)]). diff --git a/make/deps.mk b/make/deps.mk index 0f2f678c622..940ffb5823f 100644 --- a/make/deps.mk +++ b/make/deps.mk @@ -1,9 +1,11 @@ ## 3rd party dependencies DEPS = amqp_client \ + amqp_dist \ apns \ couchbeam \ cowboy \ eflame \ + eiconv \ erlang_localtime \ erlazure \ erlcloud \ @@ -47,6 +49,8 @@ endif dep_amqp_client = git https://github.com/2600hz/erlang-amqp_client.git v3.7.14 +dep_amqp_dist = git https://github.com/2600hz/erlang-amqp_dist.git aa10108f1200438fe33a6450dc0909d4cdb37f31 + dep_apns = git https://github.com/2600hz/erlang-apns4erl.git aba1fa96a4abbbb2c1628ad5d604f482aad4d12f # latest commit SHA to 2600hz branch # dep_certifi = hex 0.3.0 @@ -67,7 +71,7 @@ dep_cowboy = git https://github.com/2600hz/erlang-cowboy 2.6.3 dep_eflame = git https://github.com/slfritchie/eflame 7b0bb1a7e8c8482a59421a3a50ae69d49af59d52 # used by kz_tracers -# dep_eiconv = git https://github.com/zotonic/eiconv +dep_eiconv = git https://github.com/zotonic/eiconv 1.0.0 # used by gen_smtp dep_erlang_localtime = git https://github.com/2600hz/erlang-localtime diff --git a/rel/dev.relx.config.script b/rel/dev.relx.config.script index 70783b51323..4ad914b07c0 100644 --- a/rel/dev.relx.config.script +++ b/rel/dev.relx.config.script @@ -23,7 +23,6 @@ ToFilterOut = [rabbitmq_codegen ,'ananke' ,'amqp_cron' ,'amqp_leader' - ,'amqp_dist' ], Preparer = fun (List) -> [{E,load} || E <- List, not lists:member(E, ToFilterOut)] end, Base = [runtime_tools diff --git a/rel/kazoo b/rel/kazoo index 5395b9e0892..ea097f9ddc1 100755 --- a/rel/kazoo +++ b/rel/kazoo @@ -551,7 +551,9 @@ case "$1" in -config "$SYS_CONFIG_FILE" \ $NAME_ARG \ -setcookie $COOKIE \ - -args_file "$VM_ARGS_FILE" + -args_file "$VM_ARGS_FILE" \ + -proto_dist inet_tcp amqp \ + -start_epmd false # Dump environment info for logging purposes echo "Exec: $@" -- ${1+$ARGS}