Kafka.Context.Streaming.Flink
1.2.1
dotnet add package Kafka.Context.Streaming.Flink --version 1.2.1
NuGet\Install-Package Kafka.Context.Streaming.Flink -Version 1.2.1
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="Kafka.Context.Streaming.Flink" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kafka.Context.Streaming.Flink" Version="1.2.1" />
<PackageReference Include="Kafka.Context.Streaming.Flink" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Kafka.Context.Streaming.Flink --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Kafka.Context.Streaming.Flink, 1.2.1"
#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.
#:package Kafka.Context.Streaming.Flink@1.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Kafka.Context.Streaming.Flink&version=1.2.1
#tool nuget:?package=Kafka.Context.Streaming.Flink&version=1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Kafka.Context.Streaming.Flink
Flink SQL dialect implementation for the Kafka.Context Streaming DSL.
Source & docs: https://github.com/synthaicode/Kafka.Context Streaming API guide: https://github.com/synthaicode/Kafka.Context/blob/main/docs/wiki/streaming-api.md
Install
dotnet add package Kafka.Context.Streaming.Flink
What this package provides
- Flink SQL rendering for the engine-agnostic Streaming DSL.
- Flink-specific functions:
FlinkSql.*,FlinkAgg.*,FlinkWindow.*. - DDL generation via
ProvisionStreamingAsync()when a Flink dialect provider is configured.
Minimal usage
public sealed class AnalyticsContext : KafkaContext
{
public AnalyticsContext(IConfiguration configuration) : base(configuration) { }
public EventSet<Order> Orders { get; set; } = null!;
public EventSet<OrderStats> OrderStats { get; set; } = null!;
protected override void OnModelCreating(IModelBuilder modelBuilder)
{
modelBuilder.Entity<Order>()
.FlinkSource(s => s.EventTimeColumn(x => x.OrderTime, watermarkDelay: TimeSpan.FromSeconds(5)));
modelBuilder.Entity<OrderStats>().ToQuery(q => q
.From<Order>()
.TumbleWindow(x => x.OrderTime, TimeSpan.FromMinutes(5))
.GroupBy(x => new {
x.CustomerId,
WindowStart = FlinkWindow.Start(),
WindowEnd = FlinkWindow.End()
})
.Select(x => new OrderStats {
CustomerId = x.CustomerId,
WindowStart = FlinkWindow.Start(),
WindowEnd = FlinkWindow.End(),
TotalOrders = FlinkAgg.Count(),
TotalAmount = FlinkAgg.Sum(x.Amount)
}),
outputMode: StreamingOutputMode.Final,
sinkMode: StreamingSinkMode.Upsert);
}
protected override IStreamingDialectProvider ResolveStreamingDialectProvider()
{
var opts = Configuration.GetKsqlDslOptions();
var kafka = FlinkKafkaConnectorOptionsFactory.From(opts);
return new FlinkDialectProvider(kafka, (ddl, ct) => Task.CompletedTask);
}
}
Constraints (summary)
- Window queries cannot be combined with JOIN in a single query.
- Window GroupBy must include
FlinkWindow.Start()andFlinkWindow.End(). StreamingOutputMode.Finalis only allowed for window queries.StreamingSinkMode.Upsertis only allowed for window + CTAS queries.
Examples
- https://github.com/synthaicode/Kafka.Context/tree/main/examples/streaming-flink
- https://github.com/synthaicode/Kafka.Context/tree/main/examples/streaming-flink-flow
AI Assist
If you're unsure how to use this package, run kafka-context ai guide --copy and paste the output into your AI assistant.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Kafka.Context.Abstractions (>= 1.2.1)
- Kafka.Context.Application (>= 1.2.1)
- Kafka.Context.Streaming (>= 1.2.1)
-
net8.0
- Kafka.Context.Abstractions (>= 1.2.1)
- Kafka.Context.Application (>= 1.2.1)
- Kafka.Context.Streaming (>= 1.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.