Epam.Kafka.PubSub.EntityFramework6 2.3.92-rc

Prefix Reserved
This is a prerelease version of Epam.Kafka.PubSub.EntityFramework6.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Epam.Kafka.PubSub.EntityFramework6 --version 2.3.92-rc                
NuGet\Install-Package Epam.Kafka.PubSub.EntityFramework6 -Version 2.3.92-rc                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Epam.Kafka.PubSub.EntityFramework6" Version="2.3.92-rc" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Epam.Kafka.PubSub.EntityFramework6 --version 2.3.92-rc                
#r "nuget: Epam.Kafka.PubSub.EntityFramework6, 2.3.92-rc"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Epam.Kafka.PubSub.EntityFramework6 as a Cake Addin
#addin nuget:?package=Epam.Kafka.PubSub.EntityFramework6&version=2.3.92-rc&prerelease

// Install Epam.Kafka.PubSub.EntityFramework6 as a Cake Tool
#tool nuget:?package=Epam.Kafka.PubSub.EntityFramework6&version=2.3.92-rc&prerelease                

Epam.Kafka.PubSub.EntityFramework6

About

Epam.Kafka.PubSub.EntityFramework6 package provides entity framework 6 implementation for key abstractions defined in Epam.Kafka.PubSub.

Key Features

  • Base abstract classes DbContextSubscriptionHandler<TKey, TValue, TContext>, DbContextEntitySubscriptionHandler<TKey, TValue, TContext TEntity> to help with implementation of ISubscriptionHandler<TKey, TValue> that read data from KAFKA topics and save it to database using DbContext.
  • Default implementation of IExternalOffsetsStorage that store offsets in database via DbContext. TryAddKafkaDbContextState extension method to register it in IServiceCollection.
  • Base abstract classes DbContextPublicationHandler<TKey, TValue, TEntity, TContext> and DbContextEntityPublicationHandler<TKey, TValue, TEntity, TContext> to help with implementation of IPublicationHandler<TKey, TValue> that read data from database using DbContext and publish it to kafka topics.

How to Use

Store subscription offsets

Prepare context.

public class SampleDbContext : DbContext, IKafkaStateDbContext
{    
    public DbSet<KafkaTopicState> KafkaTopicStates => this.Set<KafkaTopicState>();

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        modelBuilder.AddKafkaState();
    }
}

Register services and setup topic partition assignment and offsets storage for subscription.

services.TryAddKafkaDbContextState<SampleDbContext>();

KafkaBuilder kafkaBuilder = services.AddKafka();
kafkaBuilder.AddSubscription<string, KafkaEntity, SubscriptionHandlerSample>("Sample")
            .WithSubscribeAndExternalOffsets();

Publish data from database to kafka

Optionally derive entity from IKafkaPublicationEntity interface to use default state management.

public class SamplePublicationEntity : IKafkaPublicationEntity
{
    public KafkaPublicationState KafkaPubState { get; set; }

    public DateTime KafkaPubNbf { get; set; }
}

Create publication handler derived from DbContextEntityPublicationHandler<TKey, TValue, TEntity, TContext> for entity with default state management or from DbContextPublicationHandler<TKey, TValue, TEntity, TContext> for custom state management.

Setup publication

KafkaBuilder kafkaBuilder = services.AddKafka();
kafkaBuilder.AddPublication<string, KafkaEntity, SamplePublicationHandler>("Sample");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.5.169-rc 65 12/10/2024
2.4.166 80 12/6/2024
2.4.164-rc 65 12/6/2024
2.4.162 87 12/2/2024
2.4.158-rc 69 12/2/2024
2.4.157-rc 65 12/2/2024
2.4.155-rc 60 12/2/2024
2.4.152-rc 55 12/2/2024
2.3.146-rc 67 10/1/2024
2.3.145 98 10/1/2024
2.3.143-rc 74 9/25/2024
2.3.140 109 7/15/2024
2.3.138-rc 67 7/15/2024
2.3.136-rc 70 7/15/2024
2.3.129-rc 82 7/11/2024
2.3.127-rc 92 7/10/2024
2.3.119-rc 86 7/9/2024
2.3.117-rc 82 7/9/2024
2.3.114-rc 86 7/8/2024
2.3.113-rc 97 7/8/2024
2.3.109-rc 90 7/8/2024
2.3.108-rc 87 7/5/2024
2.3.104-rc 90 6/28/2024
2.3.98-rc 122 6/27/2024
2.3.96-rc 98 6/26/2024
2.3.94-rc 107 6/26/2024
2.3.92-rc 89 6/25/2024
2.3.87-rc 85 6/19/2024
2.3.85-rc 93 6/19/2024
2.2.84 105 6/19/2024
2.2.80-rc 86 6/17/2024
2.2.78-rc 86 6/14/2024
2.2.61-rc 88 6/11/2024
2.1.55 99 6/7/2024
2.1.52-rc 91 6/7/2024
2.1.51-rc 91 6/7/2024
2.1.49-rc 89 6/6/2024
2.1.47-rc 82 6/4/2024
2.1.45-rc 82 6/4/2024
2.1.41-rc 94 5/29/2024
2.1.38-rc 85 5/29/2024