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 Topic { get; set; }
///
/// 分区
///
public int Partition { get; set; } = -1;
///
/// 消费者组
///
public string GroupId { get; set; }
///
/// 任务数(默认是多少个分区多少个任务)
///
public int TaskCount { get; set; } = -1;
public KafkaSubscribeAttribute(string topic, string groupId = "default")
{
this.Topic = topic;
this.GroupId = groupId;
}
public KafkaSubscribeAttribute(string topic, int partition, string groupId = "default")
{
this.Topic = topic ;
this.Partition = partition;
this.GroupId = groupId;
}
}
}