Class KafkaMessageConsumer
Inheritance
object
KafkaMessageConsumer
Implements
System.IDisposable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Volo.Abp.Kafka
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
| Type |
Description |
| System.Collections.Concurrent.ConcurrentBag<T><System.Func<T, TResult><Confluent.Kafka.Message<,><string, byte[]>, System.Threading.Tasks.Task>> |
|
ConnectionName
Declaration
protected string ConnectionName { get; }
Property Value
Consumer
Declaration
protected IConsumer<string, byte[]> Consumer { get; }
Property Value
| Type |
Description |
| Confluent.Kafka.IConsumer<,><string, byte[]> |
|
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
| Type |
Description |
| System.Threading.Tasks.Task |
|
Dispose()
Declaration
public virtual void Dispose()
HandleIncomingMessage(ConsumeResult<string, byte[]>)
Declaration
protected virtual Task HandleIncomingMessage(ConsumeResult<string, byte[]> consumeResult)
Parameters
| Type |
Name |
Description |
| Confluent.Kafka.ConsumeResult<,><string, byte[]> |
consumeResult |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Initialize(string, string, string)
Declaration
public virtual void Initialize(string topicName, string groupId, string connectionName = null)
Parameters
| Type |
Name |
Description |
| string |
topicName |
|
| string |
groupId |
|
| string |
connectionName |
|
OnMessageReceived(Func<Message<string, byte[]>, Task>)
Declaration
public virtual void OnMessageReceived(Func<Message<string, byte[]>, Task> callback)
Parameters
| Type |
Name |
Description |
| System.Func<T, TResult><Confluent.Kafka.Message<,><string, byte[]>, System.Threading.Tasks.Task> |
callback |
|
Timer_Elapsed(AbpAsyncTimer)
Declaration
protected virtual Task Timer_Elapsed(AbpAsyncTimer timer)
Parameters
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Implements
System.IDisposable
Extension Methods