Define kafka brokers per env
This commit is contained in:
@@ -41,7 +41,6 @@ config :kafka_ex,
|
||||
# {"kafka2", 9092},
|
||||
# {"kafka3", 9092}
|
||||
# ],
|
||||
brokers: "localhost:9093,localhost:9094,localhost:9095",
|
||||
#
|
||||
# OR:
|
||||
# brokers: "localhost:9092,localhost:9093,localhost:9094"
|
||||
@@ -96,4 +95,8 @@ config :kafka_ex,
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{config_env()}.exs"
|
||||
env_config = Path.expand("#{Mix.env()}.exs", __DIR__)
|
||||
|
||||
if File.exists?(env_config) do
|
||||
import_config(env_config)
|
||||
end
|
||||
|
||||
@@ -49,3 +49,6 @@ config :phoenix, :stacktrace_depth, 20
|
||||
|
||||
# Initialize plugs at runtime for faster development compilation
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
config :kafka_ex,
|
||||
brokers: "localhost:9093,localhost:9094,localhost:9095"
|
||||
|
||||
@@ -48,3 +48,10 @@ config :logger, level: :info
|
||||
# force_ssl: [hsts: true]
|
||||
#
|
||||
# Check `Plug.SSL` for all available options in `force_ssl`.
|
||||
|
||||
config :kafka_ex,
|
||||
brokers: [
|
||||
{System.get_env("KAFKA_BROKER_1_HOST"), System.get_env("KAFKA_BROKER_1_PORT")},
|
||||
{System.get_env("KAFKA_BROKER_2_HOST"), System.get_env("KAFKA_BROKER_2_PORT")},
|
||||
{System.get_env("KAFKA_BROKER_3_HOST"), System.get_env("KAFKA_BROKER_3_PORT")}
|
||||
]
|
||||
|
||||
@@ -12,3 +12,6 @@ config :logger, level: :warn
|
||||
|
||||
# Initialize plugs at runtime for faster test compilation
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
config :kafka_ex,
|
||||
disable_default_worker: true
|
||||
|
||||
Reference in New Issue
Block a user