Show / Hide Table of Contents

Class KafkaProducer<TMessage>

Inheritance
object
KafkaProducer<TMessage>
Implements
IKafkaProducer<TMessage>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NotifyHub.Kafka.Services
Assembly: NotifyHub.Kafka.dll
Syntax
public class KafkaProducer<TMessage> : IKafkaProducer<TMessage>
Type Parameters
Name Description
TMessage

Constructors

| Edit this page View Source

KafkaProducer(IOptions<KafkaOptions>)

Declaration
public KafkaProducer(IOptions<KafkaOptions> options)
Parameters
Type Name Description
IOptions<KafkaOptions> options

Methods

| Edit this page View Source

ProduceAsync(string, string, TMessage, CancellationToken)

Отправляет сообщение в Kafka.

Declaration
public Task ProduceAsync(string topicKey, string key, TMessage message, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string topicKey

Ключ топика из настроек

string key

Ключ маршрутизации

TMessage message

Сообщение для отправки.

CancellationToken cancellationToken

Токен отмены операции.

Returns
Type Description
Task

Implements

IKafkaProducer<TMessage>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX