CVSolution.KafkaExtension
1.0.2-pre4
This is a prerelease version of CVSolution.KafkaExtension.
dotnet add package CVSolution.KafkaExtension --version 1.0.2-pre4
NuGet\Install-Package CVSolution.KafkaExtension -Version 1.0.2-pre4
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="CVSolution.KafkaExtension" Version="1.0.2-pre4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CVSolution.KafkaExtension" Version="1.0.2-pre4" />
<PackageReference Include="CVSolution.KafkaExtension" />
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 CVSolution.KafkaExtension --version 1.0.2-pre4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CVSolution.KafkaExtension, 1.0.2-pre4"
#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 CVSolution.KafkaExtension@1.0.2-pre4
#: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=CVSolution.KafkaExtension&version=1.0.2-pre4&prerelease
#tool nuget:?package=CVSolution.KafkaExtension&version=1.0.2-pre4&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CVSolution.KafkaExtension
介绍
Kafka扩展
使用说明
- IOC注入
using CVSolution;
using CVSolution.KafkaExtension;
private AppConfig appConfig;
public void ConfigureServices(IServiceCollection services)
{
appConfig = ConfigTool.Instance.AddJsonFile<AppConfig>("AppConfig", false, true);
services.AddKafka(appConfig.KafkaConfig, (logName, msg) =>
{
Console.WriteLine(msg);
}, (logName, err) =>
{
Console.WriteLine(err);
});
}
- AppConfig类属性
using CVSolution.KafkaExtension;
public class AppConfig
{
public KafkaConfig KafkaConfig { get; set; }
}
- Json配置内容
{
"KafkaConfig": {
//生产者
"ProducerMsgs": [
{
"NlogName": "Producer1", // NLog Key
"Name": "Producer1", // 生产者Key(用来选择要使用的生产者)
"ServerIPs": "", // Kafka集群地址,使用“,”号分割
"Topic": "", // 生产Topic
"BatchSize": 131072,
"QueueBufferingMaxMessages": 5000000,
"EnableIdempotence": true,
"Partitioner": 0
}
],
//消费者
"ConsumerMsgs": [
{
"NlogName": "Consumer1", // NLog Key
"Name": "Consumer1", // 消费者Key(用来选择要使用的消费者)
"ServerIPs": "", // Kafka集群地址,使用“,”号分割
"Topic": "", // 消费Topic
"GroupId": "", // 消费组
"EnableAutoCommit": true,
"StatisticsIntervalMs": 5000,
"SessionTimeoutMs": 60000,
"MaxPollIntervalMs": 300000,
"HeartbeatIntervalMs": 3000,
"AutoOffsetReset": 1,
"EnablePartitionEof": true,
"PartitionAssignmentStrategy": 2
},
{
"NlogName": "Consumer2", // NLog Key
"Name": "Consumer2", // 消费者Key(用来选择要使用的消费者)
"ServerIPs": "", // Kafka集群地址,使用“,”号分割
"Topic": "", // 消费Topic
"GroupId": "", // 消费组
"EnableAutoCommit": true,
"StatisticsIntervalMs": 5000,
"SessionTimeoutMs": 60000,
"MaxPollIntervalMs": 300000,
"HeartbeatIntervalMs": 3000,
"AutoOffsetReset": 1,
"EnablePartitionEof": true,
"PartitionAssignmentStrategy": 2
}
]
},
}
- 相关方法(有空在写)
Product | Versions 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. 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 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
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.
-
.NETStandard 2.1
- Confluent.Kafka (>= 2.2.0)
- CVSolution (>= 1.0.0-pre9)
- Newtonsoft.Json (>= 13.0.2)
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 |
---|---|---|
1.0.2-pre4 | 86 | 9/5/2024 |
1.0.2-pre3 | 76 | 9/5/2024 |
1.0.2-pre2 | 76 | 7/26/2024 |
1.0.1-pre9 | 82 | 7/25/2024 |
1.0.1-pre7 | 75 | 7/25/2024 |
1.0.1-pre6 | 81 | 7/16/2024 |
1.0.1-pre3 | 72 | 7/13/2024 |
1.0.1-pre1 | 69 | 7/9/2024 |
1.0.0-pre9 | 68 | 6/5/2024 |
1.0.0-pre8 | 101 | 2/18/2024 |
1.0.0-pre7 | 191 | 12/1/2023 |
1.0.0-pre6 | 82 | 4/16/2024 |
1.0.0-pre5 | 82 | 4/16/2024 |
1.0.0-pre4 | 82 | 4/16/2024 |
1.0.0-pre3 | 89 | 9/21/2023 |
1.0.0-pre2 | 78 | 4/16/2024 |
1.0.0-pre1 | 81 | 4/16/2024 |