Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoints configuration is weird for using ENV vars #139

Open
steviee opened this issue May 7, 2024 · 0 comments
Open

Endpoints configuration is weird for using ENV vars #139

steviee opened this issue May 7, 2024 · 0 comments

Comments

@steviee
Copy link

steviee commented May 7, 2024

I was looking at this example from ElixirSchool to add a config section to my app:

config :kaffe,
  producer: [
    endpoints: [localhost: 9092],
    # endpoints references [hostname: port]. Kafka is configured to run on port 9092.
    # In this example, the hostname is localhost because we've started the Kafka server
    # straight from our machine. However, if the server is dockerized, the hostname will
    # be called whatever is specified by that container (usually "kafka")
    topics: ["our_topic", "another_topic"], # add a list of topics you plan to produce messages to
  ]

For running an app in the wild I would need to replace the hostname/port with something variable, like ENV VARS.

The top example uses strings for topics, but a list for the hostnames. How would I put ENV vars into the config? And why is it so?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant