All Projects → Farfetch → kafka-flow-retry-extensions

Farfetch / kafka-flow-retry-extensions

Licence: MIT License
Kafka Flow Retry Patterns Extensions

Programming Languages

C#
18002 projects
TSQL
950 projects

Projects that are alternatives of or similar to kafka-flow-retry-extensions

Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
Stars: ✭ 9,944 (+30975%)
Mutual labels:  fault-handler, resilience, retry-strategies, transient-fault-handling
bigbrother-specs
Research and specification for Big Brother protocol
Stars: ✭ 13 (-59.37%)
Mutual labels:  messaging
jfastnet
Fast, reliable UDP messaging for Java. Designed for games.
Stars: ✭ 26 (-18.75%)
Mutual labels:  messaging
microservices-datadriven
Sample code of application examples to build microservices with converged Oracle database and multi-cloud / hybrid cloud services
Stars: ✭ 28 (-12.5%)
Mutual labels:  messaging
ios-swift-chat-app
Open-source Voice & Video Calling and Text Chat App for Swift (iOS)
Stars: ✭ 111 (+246.88%)
Mutual labels:  messaging
geeteventbus
An inprocess eventbus for highly concurrent Python applications
Stars: ✭ 17 (-46.87%)
Mutual labels:  messaging
iniquity
A re-imagining of the iconic BBS software.
Stars: ✭ 35 (+9.38%)
Mutual labels:  messaging
pulsar-tracing
Tracing instrumentation for Apache Pulsar clients.
Stars: ✭ 13 (-59.37%)
Mutual labels:  messaging
AspNetCore.Weixin
An ASP.NET Core middleware for Wechat/Weixin message handling and apis. (微信公众平台/接口调用服务)
Stars: ✭ 24 (-25%)
Mutual labels:  messaging
fluffychat
🐑 Decentralized chat with private messages and rooms. Messages and files are encrypted using RSA
Stars: ✭ 25 (-21.87%)
Mutual labels:  messaging
azure-service-bus-dotnet-plugins
☁️ Plugins for the .NET Standard client library for Azure Service Bus
Stars: ✭ 15 (-53.12%)
Mutual labels:  messaging
udpt
UDP Transport: compress, encrypt and send any data reliably over unreliable UDP connections
Stars: ✭ 40 (+25%)
Mutual labels:  messaging
qpid-jms
Mirror of Apache Qpid JMS
Stars: ✭ 60 (+87.5%)
Mutual labels:  messaging
eventide-postgres
Event Sourcing and Microservices Stack for Ruby
Stars: ✭ 92 (+187.5%)
Mutual labels:  messaging
messaging-apis
Messaging APIs for multi-platform
Stars: ✭ 1,759 (+5396.88%)
Mutual labels:  messaging
dione
Dione is an anonymize and encrypted messaging system build on top on a peer to peer layer.
Stars: ✭ 41 (+28.13%)
Mutual labels:  messaging
fuzz-monkey
Fuzzing tool written in Golang. Insane monkey not included.
Stars: ✭ 13 (-59.37%)
Mutual labels:  resilience
ios-swift-chat-ui-kit
Ready-to-use Chat UI Components for Swift (iOS)
Stars: ✭ 42 (+31.25%)
Mutual labels:  messaging
chat21-web-widget
Live Chat Widget built with Firebase and Angular4 for customer support .
Stars: ✭ 69 (+115.63%)
Mutual labels:  messaging
Holodeck-B2B
Holodeck B2B is an AS4 system-to-system messaging solution that implements the OASIS specifications for ebMS3 and it's AS4 profile. For more information visit the project website
Stars: ✭ 45 (+40.63%)
Mutual labels:  messaging

KafkaFlow Retry Extensions

Codacy Badge

KafkaFlow Retry is a .NET framework to implement easy resilience on consumers.

KafkaFlow Retry is an extension of Kafka Flow.

Resilience policies

Policy Description Aka Required Packages
Simple Retry
(policy family)
(quickstart ; deep)
Many faults are transient and may self-correct after a short delay. "Maybe it's just a blip" KafkaFlow.Retry
Forever Retry
(policy family)
(quickstart ; deep)
Many faults are semi-transient and may self-correct after multiple retries. "Never give up" KafkaFlow.Retry
Durable Retry
(quickstart ; deep)
Beyond a certain amount of retries and wait, you want to keep processing next-in-line messages but you can't loss the current offset message. As persistance databases, MongoDb or SqlServer are available. And you can manage in-retry messages through HTTP API. "I can't stop processing messages but I can't loss messages" KafkaFlow.Retry
KafkaFlow.Retry.API

KafkaFlow.Retry.SqlServer
or
KafkaFlow.Retry.MongoDb

Installing via NuGet

Install packages related to your context. The Core package is required for all other packages.

Requirements

.NET Core 2.1 and later using Hosted Service

Packages

Name nuget.org
KafkaFlow.Retry Nuget Package Nuget downloads
KafkaFlow.Retry.API Nuget Package Nuget downloads
KafkaFlow.Retry.MongoDb Nuget Package Nuget downloads
KafkaFlow.Retry.SqlServer Nuget Package Nuget downloads

Core package

Install-Package KafkaFlow.Retry

HTTP API package

Install-Package KafkaFlow.Retry.API

MongoDb package

Install-Package KafkaFlow.Retry.MongoDb

SqlServer package

Install-Package KafkaFlow.Retry.SqlServer

Usage – Simple and Forever retries policies

Simple

.AddMiddlewares(
    middlewares => middlewares // KafkaFlow middlewares
    .RetrySimple(
        (config) => config
            .Handle<ExternalGatewayException>() // Exceptions to be handled
            .TryTimes(3)
            .WithTimeBetweenTriesPlan((retryCount) => 
                TimeSpan.FromMilliseconds(Math.Pow(2, retryCount)*1000) // exponential backoff
            )
    )

Forever

.AddMiddlewares( 
    middlewares => middlewares // KafkaFlow middlewares
    .RetryForever(
        (config) => config
            .Handle<DatabaseTimeoutException>() // Exceptions to be handled
            .WithTimeBetweenTriesPlan(
                TimeSpan.FromMilliseconds(500),
                TimeSpan.FromMilliseconds(1000)
            )
    )
 

Usage – Durable retry policy

Durable

.AddMiddlewares( 
    middlewares => middlewares // KafkaFlow middlewares
    .RetryDurable(
            config => config
                .Handle<NonBlockingException>() // Exceptions to be handled
                .WithMessageType(typeof(TestMessage)) // Message type to be consumed
                .WithEmbeddedRetryCluster( // Retry consumer config
                    cluster,
                    config => config
                        .WithRetryTopicName("test-topic-retry")
                        .WithRetryConsumerBufferSize(4)
                        .WithRetryConsumerWorkersCount(2)
                        .WithRetryConusmerStrategy(RetryConsumerStrategy.GuaranteeOrderedConsumption)
                        .WithRetryTypedHandlers(
                            handlers => handlers
                                .WithHandlerLifetime(InstanceLifetime.Transient)
                                .AddHandler<Handler>()
                        ).Enabled(true)
                )
                .WithQueuePollingJobConfiguration( // Polling configuration
                    config => config
                        .WithId("custom_search_key")
                        .WithCronExpression("0 0/1 * 1/1 * ? *")
                        .WithExpirationIntervalFactor(1)
                        .WithFetchSize(10)
                        .Enabled(true)
                )                      
                .WithMongoDbDataProvider( // Persistence configuration
                    mongoDbconnectionString,
                    mongoDbdatabaseName,
                    mongoDbretryQueueCollectionName,
                    mongoDbretryQueueItemCollectionName
                )          
                .WithRetryPlanBeforeRetryDurable( // Chained simple retry before triggering durable 
                    config => config
                        .TryTimes(3)
                        .WithTimeBetweenTriesPlan(
                            TimeSpan.FromMilliseconds(250),
                            TimeSpan.FromMilliseconds(500),
                            TimeSpan.FromMilliseconds(1000))
                        .ShouldPauseConsumer(false)
                )
        )
    )

See the setup page and samples for more details

Documentation

Wiki Page

Contributing

Read the Contributing guidelines

Maintainers

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].