增加RCU上离线功能,能耗双通道

This commit is contained in:
2026-01-15 17:32:26 +08:00
parent b746a1da1a
commit 10bf712006
148 changed files with 8075 additions and 290 deletions

View File

@@ -1,5 +1,6 @@
using BLWData.Entity;
using Confluent.Kafka;
using System.Text;
using static Confluent.Kafka.ConfigPropertyNames;
namespace
@@ -8,9 +9,10 @@ namespace 消费
{
static void Main(string[] args)
{
RunConsumers().Wait();
ShengChan().Wait();
//RunConsumers().Wait();
Console.WriteLine("Hello, World!");
Console.ReadKey();
Console.ReadLine();
}
@@ -36,6 +38,25 @@ namespace 消费
//await StartConsumer(cts.Token);
}
async public static Task ShengChan()
{
var config = new ConsumerConfig
{
BootstrapServers = "172.16.4.132:19092",
SecurityProtocol = SecurityProtocol.SaslPlaintext,
SaslMechanism = SaslMechanism.Plain,
SaslUsername = "blwmomo",
SaslPassword = "blwmomo"
};
var p = new ProducerBuilder<string, byte[]>(config).Build();
var bytes = Encoding.UTF8.GetBytes("Hello");
for (int i = 0; i < 10; i++)
{
var dr = await p.ProduceAsync("test", new Message<string, byte[]> { Key = "abc", Value = bytes });
}
}
private static async Task StartConsumer(CancellationToken cancellationToken)
{

12
消费/生产.cs Normal file
View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace
{
internal class
{
}
}