Code Monkey home page Code Monkey logo

kafka-flow's Introduction

KafkaFlow

Build Master Codacy Badge Slack

KafkaFlow is a .NET framework to create Kafka based applications, simple to use and extend.

KafkaFlow uses Confluent Kafka Client.

Features

  • Multi-threaded consumer with message order guarantee
  • Middlewares support for producing and consuming messages
  • Support topics with different message types
  • Consumers with many topics
  • Serializer middleware with ApacheAvro, ProtoBuf and Json algorithms
  • Schema Registry support
  • Compression using native Confluent Kafka client compression or compressor middlewares
  • Graceful shutdown (wait to finish processing to shutdown)
  • Store offset when processing ends, avoiding message loss
  • Supports .NET Core and .NET Framework
  • Can be used with any dependency injection framework (see here)
  • Fluent configuration
  • Admin Web API that allows pause, resume and restart consumers, change workers count and rewind offsets, all at runtime
  • Dashboard UI that allows to visualize relevant informations about all consumers and manage them

Installation

Check the setup page

Usage

Build for .NET Core 2.1 and later using Hosted Service

public static void Main(string[] args)
{
    Host
        .CreateDefaultBuilder(args)
        .ConfigureServices((hostContext, services) =>
        {
            services.AddKafkaFlowHostedService(kafka => kafka
                .UseConsoleLog()
                .AddCluster(cluster => cluster
                    .WithBrokers(new[] { "localhost:9092" })
                    .AddConsumer(consumer => consumer
                        .Topic("sample-topic")
                        .WithGroupId("sample-group")
                        .WithBufferSize(100)
                        .WithWorkersCount(10)
                        .AddMiddlewares(middlewares => middlewares
                            .AddSerializer<NewtonsoftJsonMessageSerializer>()
                            .AddTypedHandlers(handlers => handlers
                                .AddHandler<SampleMessageHandler>())
                        )
                    )
                    .AddProducer("producer-name", producer => producer
                        .DefaultTopic("sample-topic")
                        .AddMiddlewares(middlewares => middlewares
                            .AddSerializer<NewtonsoftJsonMessageSerializer>()
                        )
                    )
                )
            );
        })
        .Build()
        .Run();
}

See samples for more details

Documentation

Wiki Page

Contributing

Read the Contributing guidelines

Authors

We are available through Issues, Discussions or Slack

License

MIT

kafka-flow's People

Contributors

filipeesch avatar 3cpt avatar pmfernandes avatar joelfoliveira avatar massada avatar miguelcosta avatar pvoliveira avatar slang25 avatar ailtonguitar avatar ievgenii-shepeliuk avatar martinhonovais avatar marcio-azevedo avatar ricardofelgueiras 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.