Skip to content

Commit

Permalink
Merge pull request #317 from skateinmars/readme-applications
Browse files Browse the repository at this point in the history
Clarify requirements for application configuration with elixir >= 1.4
  • Loading branch information
joshuawscott authored Oct 15, 2018
2 parents 10699a4 + 442a108 commit a745ca0
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ for details of these features.
## Using KafkaEx in an Elixir project

The standard approach for adding dependencies to an Elixir application applies:
add KafkaEx to the deps and applications lists in your project's mix.exs file.
add KafkaEx to the deps list in your project's mix.exs file.
You may also optionally add
[snappy-erlang-nif](https://github.com/fdmanana/snappy-erlang-nif) (required
only if you want to use snappy compression).
Expand All @@ -43,17 +43,6 @@ only if you want to use snappy compression).
defmodule MyApp.Mixfile do
# ...

def application do
[
mod: {MyApp, []},
applications: [
# add to existing apps - :logger, etc..
:kafka_ex,
:snappy # if using snappy compression
]
]
end

defp deps do
[
# add to your existing deps
Expand All @@ -67,6 +56,28 @@ end

Then run `mix deps.get` to fetch dependencies.

### Adding kafka_ex application

When using elixir < 1.4, you will need to add kafka_ex to the applications list of your mix.exs file.

```elixir
# mix.exs
defmodule MyApp.Mixfile do
# ...

def application do
[
mod: {MyApp, []},
applications: [
# add to existing apps - :logger, etc..
:kafka_ex,
:snappy # if using snappy compression
]
]
end
end
```

## Configuration

See [config/config.exs](https://github.com/kafkaex/kafka_ex/blob/master/config/config.exs)
Expand Down

0 comments on commit a745ca0

Please sign in to comment.