reachfh / brod_group_subscriber_example

Example Elixir app which uses brod_group_subscriber to consume Kafka messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

brod_group_subscriber_example

Installation

Kafka:

brew install kafka
brew services start zookeeper
brew services start kafka

Generate a Kafka message from Elixir console:

:brod.produce_sync_offset(:client1, "foo", :random, "the key", "the value")

TODO

  • Extract trace context from message kafka headers and use in dlc send

  • Use link?

  • service.name is wrong Set service.name in span?

    # {"service.name", @app},
    # {"peer.service", @app},
    
  • Log time is wrong (very large)

  • set_status is not working?

  • Use retries for error handling

  • Maybe sleep

start_time = System.monotonic_time()
result = process_message(message, state)
processing_duration = System.monotonic_time() - start_time

About

Example Elixir app which uses brod_group_subscriber to consume Kafka messages

License:Apache License 2.0


Languages

Language:Elixir 100.0%