Interface IKafkaProducerEndpointBuilder
Builds the KafkaProducerEndpoint.
Inherited Members
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public interface IKafkaProducerEndpointBuilder : IProducerEndpointBuilder<IKafkaProducerEndpointBuilder>, IEndpointBuilder<IKafkaProducerEndpointBuilder>
Methods
| Improve this doc View sourceConfigure(Action<KafkaProducerConfig>)
Configures the Kafka client properties.
Declaration
IKafkaProducerEndpointBuilder Configure(Action<KafkaProducerConfig> configAction)
Parameters
Type | Name | Description |
---|---|---|
Action<KafkaProducerConfig> | configAction | An Action<T> that takes the KafkaProducerConfig and configures it. |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(Func<IOutboundEnvelope, IServiceProvider, string?>, Func<IOutboundEnvelope, IServiceProvider, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo(Func<IOutboundEnvelope, IServiceProvider, string?> topicNameFunction, Func<IOutboundEnvelope, IServiceProvider, int>? partitionFunction = null)
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope, IServiceProvider, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Func<IOutboundEnvelope, IServiceProvider, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(Func<IOutboundEnvelope, string?>, Func<IOutboundEnvelope, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo(Func<IOutboundEnvelope, string?> topicNameFunction, Func<IOutboundEnvelope, int>? partitionFunction = null)
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Func<IOutboundEnvelope, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(string, Func<IOutboundEnvelope, string[]>, Func<IOutboundEnvelope, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo(string topicNameFormatString, Func<IOutboundEnvelope, string[]> topicNameArgumentsFunction, Func<IOutboundEnvelope, int>? partitionFunction = null)
Parameters
Type | Name | Description |
---|---|---|
string | topicNameFormatString | The endpoint name format string that will be combined with the arguments returned by the
|
Func<IOutboundEnvelope, string[]> | topicNameArgumentsFunction | The function returning the arguments to be used to format the string. |
Func<IOutboundEnvelope, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo(string, int?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo(string topicName, int? partition = null)
Parameters
Type | Name | Description |
---|---|---|
string | topicName | The name of the topic. |
int? | partition | The optional partition index. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, IServiceProvider, string?>, Func<IOutboundEnvelope<TMessage>, IServiceProvider, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, IServiceProvider, string?> topicNameFunction, Func<IOutboundEnvelope<TMessage>, IServiceProvider, int>? partitionFunction = null) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, IServiceProvider, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Func<IOutboundEnvelope<TMessage>, IServiceProvider, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, string?>, Func<IOutboundEnvelope<TMessage>, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo<TMessage>(Func<IOutboundEnvelope<TMessage>, string?> topicNameFunction, Func<IOutboundEnvelope<TMessage>, int>? partitionFunction = null) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, string> | topicNameFunction | The function returning the topic name for the message being produced. If the function returns
|
Func<IOutboundEnvelope<TMessage>, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
ProduceTo<TMessage>(string, Func<IOutboundEnvelope<TMessage>, string[]>, Func<IOutboundEnvelope<TMessage>, int>?)
Specifies the name of the topic and optionally the target partition.
Declaration
IKafkaProducerEndpointBuilder ProduceTo<TMessage>(string topicNameFormatString, Func<IOutboundEnvelope<TMessage>, string[]> topicNameArgumentsFunction, Func<IOutboundEnvelope<TMessage>, int>? partitionFunction = null) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
string | topicNameFormatString | The endpoint name format string that will be combined with the arguments returned by the
|
Func<IOutboundEnvelope<TMessage>, string[]> | topicNameArgumentsFunction | The function returning the arguments to be used to format the string. |
Func<IOutboundEnvelope<TMessage>, int> | partitionFunction | The optional function returning the target partition index for the message being produced. If |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages being produced. |
UseEndpointNameResolver<TResolver>()
Specifies the type of the IKafkaProducerEndpointNameResolver to be used to resolve the actual endpoint name and partition.
Declaration
IKafkaProducerEndpointBuilder UseEndpointNameResolver<TResolver>() where TResolver : IKafkaProducerEndpointNameResolver
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The IKafkaProducerEndpointBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TResolver | The type of the IKafkaProducerEndpointNameResolver to be used. |
WithKafkaKey<TMessage>(Func<IOutboundEnvelope<TMessage>, object?>)
Uses the specified value provider function to set the kafka key for each produced message.
Declaration
IKafkaProducerEndpointBuilder WithKafkaKey<TMessage>(Func<IOutboundEnvelope<TMessage>, object?> valueProvider) where TMessage : class
Parameters
Type | Name | Description |
---|---|---|
Func<IOutboundEnvelope<TMessage>, object> | valueProvider | The value provider function. |
Returns
Type | Description |
---|---|
IKafkaProducerEndpointBuilder | The endpoint builder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be enriched. |