Class KafkaMessageConsumer
Inheritance
System.Object
KafkaMessageConsumer
Implements
ITransientDependency
IDisposable
Assembly: Volo.Abp.Kafka.dll
Syntax
public class KafkaMessageConsumer : object, IKafkaMessageConsumer, ITransientDependency, IDisposable
Constructors
KafkaMessageConsumer(IConsumerPool, IExceptionNotifier, IOptions<AbpKafkaOptions>)
Declaration
public KafkaMessageConsumer(IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier, IOptions<AbpKafkaOptions> options)
Parameters
Properties
Callbacks
Declaration
protected ConcurrentBag<Func<Message<string, byte[]>, Task>> Callbacks { get; }
Property Value
Type |
Description |
ConcurrentBag<Func<Message<System.String, System.Byte[]>, Task>> |
|
ConnectionName
Declaration
protected string ConnectionName { get; }
Property Value
Type |
Description |
System.String |
|
Consumer
Declaration
protected IConsumer<string, byte[]> Consumer { get; }
Property Value
Type |
Description |
IConsumer<System.String, System.Byte[]> |
|
ConsumerPool
Declaration
protected IConsumerPool ConsumerPool { get; }
Property Value
ExceptionNotifier
Declaration
protected IExceptionNotifier ExceptionNotifier { get; }
Property Value
Type |
Description |
IExceptionNotifier |
|
GroupId
Declaration
protected string GroupId { get; }
Property Value
Type |
Description |
System.String |
|
Logger
Declaration
public ILogger<KafkaMessageConsumer> Logger { get; set; }
Property Value
Options
Declaration
protected AbpKafkaOptions Options { get; }
Property Value
TopicName
Declaration
protected string TopicName { get; }
Property Value
Type |
Description |
System.String |
|
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<System.String, System.Byte[]> |
consumeResult |
|
Returns
Initialize(String, String, String)
Declaration
public virtual void Initialize(string topicName, string groupId, string connectionName = null)
Parameters
Type |
Name |
Description |
System.String |
topicName |
|
System.String |
groupId |
|
System.String |
connectionName |
|
OnMessageReceived(Func<Message<String, Byte[]>, Task>)
Declaration
public virtual void OnMessageReceived(Func<Message<string, byte[]>, Task> callback)
Parameters
Type |
Name |
Description |
Func<Message<System.String, System.Byte[]>, Task> |
callback |
|
Implements
ITransientDependency
IDisposable
Extension Methods