using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JiShe.CollectBus.Kafka.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class KafkaSubscribeAttribute : Attribute
{
///
/// 订阅的主题
///
public string[] Topics { get; set; }
///
/// 分区
///
public int Partition { get; set; } = -1;
///
/// 消费者组
///
public string GroupId { get; set; } = "default";
public KafkaSubscribeAttribute(string[] topics)
{
this.Topics = topics;
}
public KafkaSubscribeAttribute(string[] topics, string groupId)
{
this.Topics = topics;
this.GroupId = groupId;
}
public KafkaSubscribeAttribute(string[] topics, int partition)
{
this.Topics = topics;
this.Partition = partition;
}
public KafkaSubscribeAttribute(string[] topics, int partition, string groupId)
{
this.Topics = topics;
this.Partition = partition;
this.GroupId = groupId;
}
}
}