Skip to content

Use Dekaf by default for Kafka on all target frameworks#4038

Open
marcschier wants to merge 4 commits into
masterfrom
marcschier/dekaf-all-tfms
Open

Use Dekaf by default for Kafka on all target frameworks#4038
marcschier wants to merge 4 commits into
masterfrom
marcschier/dekaf-all-tfms

Conversation

@marcschier

@marcschier marcschier commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Upgrade the Kafka transport from Dekaf 1.2.0 to 1.7.0 and use the pure-managed Dekaf adapter by default on every supported target framework.

  • Enable the Dekaf adapter and its guard tests on net472, net48, netstandard2.1, net8.0, net9.0, and net10.0.
  • Retain the Confluent.Kafka adapter and factory as an opt-in DI backend through WithConfluentKafkaClient().
  • Update the central dependency pins required by Dekaf 1.7.0.
  • Validate NativeAOT/trimming compatibility on net10.0 for the default Dekaf backend; the opt-in Confluent backend remains JIT-only.
  • Avoid per-header allocation on .NET Framework when Dekaf header memory is array-backed.

Validation:

  • Release builds passed with zero warnings for all six library target frameworks.
  • Kafka adapter and DI selection tests passed on net48 and net10.0.
  • dotnet publish tests\Opc.Ua.Aot.Tests\Opc.Ua.Aot.Tests.csproj -c Release -r win-x64 --self-contained true
  • The generated NuGet package includes Dekaf 1.7.0 and Confluent.Kafka 2.15.0 for every target framework.

Related Issues

None.

Checklist

  • I have signed the CLA and read the CONTRIBUTING doc.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added all necessary documentation.
  • I have verified that my changes do not introduce (new) build or analyzer warnings.
  • I ran all tests locally using the UA.slnx solution against at least .net framework and .net 10, and all passed.
  • I fixed all failing and flaky tests in the CI pipelines and all CodeQL warnings.
  • I have addressed all PR feedback received.

Copilot AI review requested due to automatic review settings July 19, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR upgrades the Kafka transport to Dekaf 1.7.0 and standardizes on the managed Dekaf adapter across all supported target frameworks, removing the TFM-specific Confluent.Kafka / native librdkafka fallback.

Changes:

  • Upgrade Dekaf from 1.2.0 to 1.7.0 and remove Confluent.Kafka usage.
  • Make Dekaf adapter/factory and guard tests compile/run on all target frameworks (incl. .NET Framework).
  • Refresh Kafka / NativeAOT documentation and align comments with the new single-client approach.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/Opc.Ua.PubSub.Kafka.Tests/KafkaIntegrationDockerTests.cs Updates integration-test comments to reflect Dekaf-only behavior.
tests/Opc.Ua.PubSub.Kafka.Tests/KafkaClientAdapterGuardTests.cs Removes net10-only compile guard so guard tests cover all TFMs.
tests/Opc.Ua.Aot.Tests/Opc.Ua.Aot.Tests.csproj Updates AOT test project comment to reflect Dekaf usage beyond net10.
src/Opc.Ua.PubSub.Kafka/Opc.Ua.PubSub.Kafka.csproj Switches package reference to Dekaf for all TFMs; removes Confluent.Kafka conditional.
src/Opc.Ua.PubSub.Kafka/NugetREADME.md Updates NuGet README to describe Dekaf-only client and AOT story.
src/Opc.Ua.PubSub.Kafka/KafkaTlsOptions.cs Documentation tweaks to remove librdkafka-specific wording.
src/Opc.Ua.PubSub.Kafka/KafkaQualityOfService.cs Documentation tweak to remove librdkafka-specific wording.
src/Opc.Ua.PubSub.Kafka/KafkaConnectionOptions.cs Documentation tweaks to remove librdkafka-specific wording.
src/Opc.Ua.PubSub.Kafka/KafkaBrokerTransport.cs Documentation tweak to remove Confluent-specific wording.
src/Opc.Ua.PubSub.Kafka/Internal/DekafKafkaClientFactory.cs Removes net10-only compile guard for Dekaf factory.
src/Opc.Ua.PubSub.Kafka/Internal/DekafKafkaClientAdapter.cs Removes net10-only compile guard; adds .NET Framework UTF-8 header decoding path.
src/Opc.Ua.PubSub.Kafka/Internal/ConfluentKafkaClientFactory.cs Removes Confluent factory implementation (no longer needed).
src/Opc.Ua.PubSub.Kafka/Internal/ConfluentKafkaClientAdapter.cs Removes Confluent adapter implementation (no longer needed).
src/Opc.Ua.PubSub.Kafka/EventIds.cs Removes Confluent adapter event id constant.
src/Opc.Ua.PubSub.Kafka/DependencyInjection/KafkaTransportServiceCollectionExtensions.cs Registers Dekaf factory on all TFMs; removes TFM branching.
docs/PubSub.md Refreshes PubSub docs to reflect Dekaf-only and updated NativeAOT positioning.
Directory.Packages.props Upgrades Dekaf version and adjusts a few dependency pins.

Comment thread src/Opc.Ua.PubSub.Kafka/Internal/DekafKafkaClientAdapter.cs
Comment thread src/Opc.Ua.PubSub.Kafka/Opc.Ua.PubSub.Kafka.csproj Outdated
Comment thread Directory.Packages.props
Comment thread Directory.Packages.props
Comment thread Directory.Packages.props
Comment thread Directory.Packages.props
Comment thread Directory.Packages.props Outdated
Comment thread Directory.Packages.props
@marcschier marcschier changed the title Use Dekaf for Kafka on all target frameworks Use Dekaf by default for Kafka on all target frameworks Jul 20, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.45%. Comparing base (12f770b) to head (553c62d).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...ction/KafkaTransportServiceCollectionExtensions.cs 60.00% 1 Missing and 1 partial ⚠️
...a.PubSub.Kafka/Internal/DekafKafkaClientAdapter.cs 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4038      +/-   ##
==========================================
- Coverage   73.86%   73.45%   -0.42%     
==========================================
  Files        1345     1347       +2     
  Lines      180038   180385     +347     
  Branches    31678    31751      +73     
==========================================
- Hits       132993   132495     -498     
- Misses      36290    37171     +881     
+ Partials    10755    10719      -36     
Files with missing lines Coverage Δ
...bSub.Kafka/Internal/ConfluentKafkaClientAdapter.cs 3.06% <ø> (ø)
...bSub.Kafka/Internal/ConfluentKafkaClientFactory.cs 20.00% <ø> (ø)
...a.PubSub.Kafka/Internal/DekafKafkaClientFactory.cs 20.00% <ø> (ø)
src/Opc.Ua.PubSub.Kafka/KafkaBrokerTransport.cs 78.44% <ø> (ø)
src/Opc.Ua.PubSub.Kafka/KafkaConnectionOptions.cs 100.00% <ø> (ø)
src/Opc.Ua.PubSub.Kafka/KafkaQualityOfService.cs 100.00% <ø> (ø)
src/Opc.Ua.PubSub.Kafka/KafkaTlsOptions.cs 0.00% <ø> (ø)
...ction/KafkaTransportServiceCollectionExtensions.cs 68.62% <60.00%> (-0.94%) ⬇️
...a.PubSub.Kafka/Internal/DekafKafkaClientAdapter.cs 80.65% <33.33%> (-0.30%) ⬇️

... and 49 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants