Giter Site home page Giter Site logo

elsa's Introduction

Elsa

Description

Elsa is a full-featured Kafka library written in Elixir and extending the :brod library with additional support from the :kafka_protocol Erlang libraries to provide capabilities not available in :brod.

Elsa has the following goals:

  • Run entirely as a library (only start processes explicitly listed in your supervision tree)
  • Draw none of its configuration from the calling application's app env
  • Minimize and isolate failures in the broker/consumer interaction

As Elsa draws from the Brod library (named for Kafka friend and biographer Max Brod), it is named for Elsa Taussig, Brod's wife.

Installation

The package can be installed by adding elsa to your list of dependencies in mix.exs:

def deps do
  [
    {:elsa, "~> 1.0.0-rc.2"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/elsa.

Usage

To use Elsa in your application, configure the start of the top-level supervisor to run and pass it the necessary arguments as a keyword list. Below is an example of the arguments as they might be defined in the application environment config.exs or runtime.exs files.

config :my_app, :elsa,
  endpoints: [localhost: 9092],
  name: :myapp_elsa,
  producer: [
    topic: "outgoing-stream"
  ],
  group_consumer: [
    group: "data-stream-group",
    topics: ["incoming-streaming"],
    handler: MyApp.MessageHandler,
    handler_init_args: %{},
    config: [
      begin_offset: :earliest
    ]
  ],
  consumer: [
    topic: "incoming-stream",
    partition: 0,
    begin_offset: :earliest,
    handler: MyApp.MessageHandler
  ]

Note that each Elsa supervisor tree requires a single list of Kafka brokers and a single name. Beyond that, defining consumer groups or producers is optional (although defining neither will result in a relatively useless Elsa supervisor and registry).

Producers may be a single producer or a list of producers, differentiated by their topic, therefore Elsa allows a one-to-many association of supervision tree to producers.

Consumers and consumer groups, in contrast, have a one-to-one relationship to an Elsa supervision tree, therefore you cannot define a nested list of consumer or group_consumer keyword arguments within your Elsa configuration.

Example

You can find an example of configuring and using Elsa here.

Testing

Elsa uses the standard ExUnit testing library for unit testing. For integration testing interactions with Kafka, it uses the divo library. Run tests with the command mix test.integration.

elsa's People

Contributors

jeffgrunewald avatar jdenen avatar bbalser avatar keathley avatar jakeprem avatar fxn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.