Class KafkaMessageConsumer
Inheritance
KafkaMessageConsumer
Assembly: Volo.Abp.Kafka.dll
Syntax
public class KafkaMessageConsumer : IKafkaMessageConsumer, ITransientDependency, IDisposable
Constructors
KafkaMessageConsumer(IConsumerPool, IExceptionNotifier, IOptions<AbpKafkaOptions>, IProducerPool, AbpAsyncTimer)
Declaration
public KafkaMessageConsumer(IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, IOptions<AbpKafkaOptions> options, IProducerPool producerPool, AbpAsyncTimer timer)
Parameters
Properties
Callbacks
Declaration
protected ConcurrentBag<Func<Message<string, byte[]>, Task>> Callbacks { get; }
Property Value
ConnectionName
Declaration
protected string? ConnectionName { get; }
Property Value
Consumer
Declaration
protected IConsumer<string, byte[]>? Consumer { get; }
Property Value
ConsumerPool
Declaration
protected IConsumerPool ConsumerPool { get; }
Property Value
ExceptionNotifier
Declaration
protected IExceptionNotifier ExceptionNotifier { get; }
Property Value
GroupId
Declaration
protected string GroupId { get; }
Property Value
Logger
Declaration
public ILogger<KafkaMessageConsumer> Logger { get; set; }
Property Value
Options
Declaration
protected AbpKafkaOptions Options { get; }
Property Value
ProducerPool
Declaration
protected IProducerPool ProducerPool { get; }
Property Value
Timer
Declaration
protected AbpAsyncTimer Timer { get; }
Property Value
TopicName
Declaration
protected string TopicName { get; }
Property Value
Methods
Consume()
Declaration
protected virtual void Consume()
CreateTopicAsync()
Declaration
protected virtual Task CreateTopicAsync()
Returns
Dispose()
Declaration
public virtual void Dispose()
HandleIncomingMessage(ConsumeResult<string, byte[]>)
Declaration
protected virtual Task HandleIncomingMessage(ConsumeResult<string, byte[]> consumeResult)
Parameters
Type |
Name |
Description |
ConsumeResult<string, byte[]> |
consumeResult |
|
Returns
Initialize(string, string, string?)
Declaration
public virtual void Initialize(string topicName, string groupId, string? connectionName = null)
Parameters
OnMessageReceived(Func<Message<string, byte[]>, Task>)
Declaration
public virtual void OnMessageReceived(Func<Message<string, byte[]>, Task> callback)
Parameters
Timer_Elapsed(AbpAsyncTimer)
Declaration
protected virtual Task Timer_Elapsed(AbpAsyncTimer timer)
Parameters
Returns
Implements
Extension Methods