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

Doc: Auto offset reset config #442

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ config :kafka_ex,
# Threshold number of messages consumed for GenConsumer to commit offsets
# to the broker.
commit_threshold: 100,
# The policy for resetting offsets when an :offset_out_of_range error occurs
# Options:
# - `:earliest` - Will move to the offset to the oldest available
# - `:latest` - Will move the offset to the most recent.
# - `:none` - The error will simply be raised
auto_offset_reset: :none,
# Interval in milliseconds to wait before reconnect to kafka
sleep_for_reconnect: 400,
# This is the flag that enables use of ssl
Expand Down
6 changes: 3 additions & 3 deletions lib/kafka_ex/gen_consumer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ defmodule KafkaEx.GenConsumer do
implemented, the default implementation calls to `init/2`, dropping the extra
arguments.

Both `:commit_interval` and `:commit_threshold` default to the application
config (e.g., `Application.get_env/2`) if that value is present, or the
stated default if the application config is not present.
**NOTE** `:commit_interval`, `auto_commit_reset` and `:commit_threshold` default to the
application config (e.g., `Application.get_env/2`) if that value is present, or the stated
default if the application config is not present.

Any valid options for `GenServer.start_link/3` can also be specified.

Expand Down