Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1003 Bytes

README.md

File metadata and controls

54 lines (38 loc) · 1003 Bytes

Brodex

Installation

If available in Hex, the package can be installed by adding brodex to your list of dependencies in mix.exs:

def deps do
  [
    {:brodex, git: "https://github.com/PRAVALER/brodex"}
  ]
end

Configuration

See config/config.exs for a description of configuration variables, including the Kafka broker list and default consumer group.

Consumer Configs

import Config

alias BrodexExampleWeb.ConsumerTest

config :brodex,
    kafka_topics: [
      %{name: :topic_test, topic: "topic-test", partitions: :all, module: ConsumerTest}
    ]

Usage Examples

Consumer Groups

To use a consumer group, first implement a handler module using Brodex.Consumer.

defmodule BrodexExampleWeb.ConsumerTest do

  use Brodex.Consumer

  @impl true
  def handler(data) do
    IO.inspect(data, label: "data")
    {:ok, true}
  end
end