69 lines
1.7 KiB
C#
69 lines
1.7 KiB
C#
using Confluent.Kafka;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace JiShe.CollectBus.Kafka
|
|
{
|
|
public class KafkaOptionConfig
|
|
{
|
|
/// <summary>
|
|
/// kafka地址
|
|
/// </summary>
|
|
public string BootstrapServers { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// 服务器标识
|
|
/// </summary>
|
|
public string ServerTagName { get; set; }= "KafkaFilterKey";
|
|
|
|
/// <summary>
|
|
/// kafka主题副本数量
|
|
/// </summary>
|
|
public short KafkaReplicationFactor { get; set; }
|
|
|
|
/// <summary>
|
|
/// kafka主题分区数量
|
|
/// </summary>
|
|
public int NumPartitions { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否开启过滤器
|
|
/// </summary>
|
|
public bool EnableFilter { get; set; }= true;
|
|
|
|
/// <summary>
|
|
/// 是否开启认证
|
|
/// </summary>
|
|
public bool EnableAuthorization { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// 安全协议
|
|
/// </summary>
|
|
public SecurityProtocol SecurityProtocol { get; set; } = SecurityProtocol.SaslPlaintext;
|
|
|
|
/// <summary>
|
|
/// 认证方式
|
|
/// </summary>
|
|
public SaslMechanism SaslMechanism { get; set; }= SaslMechanism.Plain;
|
|
|
|
/// <summary>
|
|
/// 用户名
|
|
/// </summary>
|
|
public string? SaslUserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 密码
|
|
/// </summary>
|
|
public string? SaslPassword { get; set; }
|
|
|
|
/// <summary>
|
|
/// 首次采集时间
|
|
/// </summary>
|
|
public DateTime FirstCollectionTime { get; set; }
|
|
|
|
}
|
|
}
|