Interface IKafkaEndpointsConfigurationBuilder
Exposes the methods to configure the connection to Kafka and add the inbound and outbound endpoints.
Inherited Members
Namespace: Silverback.Messaging.Configuration.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public interface IKafkaEndpointsConfigurationBuilder : IEndpointsConfigurationBuilder
Methods
| Improve this doc View sourceAddInbound(Action<IKafkaConsumerEndpointBuilder>, int)
Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddInbound(Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
Parameters
Type | Name | Description |
---|---|---|
Action<IKafkaConsumerEndpointBuilder> | endpointBuilderAction | An Action<T> that takes the IKafkaConsumerEndpointBuilder and configures it. |
int | consumersCount | The number of consumers to be instantiated. The default is 1. |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Remarks
Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The KafkaConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.
AddInbound(Type?, Action<IKafkaConsumerEndpointBuilder>, int)
Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddInbound(Type? messageType, Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the messages that will be consumed from this endpoint. Specifying the message type will usually automatically switch to the typed message serializer and deserialize this specific type, regardless of the message headers. |
Action<IKafkaConsumerEndpointBuilder> | endpointBuilderAction | An Action<T> that takes the IKafkaConsumerEndpointBuilder and configures it. |
int | consumersCount | The number of consumers to be instantiated. The default is 1. |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Remarks
Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The KafkaConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.
AddInbound<TMessage>(Action<IKafkaConsumerEndpointBuilder>, int)
Adds an inbound endpoint and instantiates a KafkaConsumer to consume from a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddInbound<TMessage>(Action<IKafkaConsumerEndpointBuilder> endpointBuilderAction, int consumersCount = 1)
Parameters
Type | Name | Description |
---|---|---|
Action<IKafkaConsumerEndpointBuilder> | endpointBuilderAction | An Action<T> that takes the IKafkaConsumerEndpointBuilder and configures it. |
int | consumersCount | The number of consumers to be instantiated. The default is 1. |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages that will be consumed from this endpoint. Specifying the message type will usually automatically switch to the typed message serializer and deserialize this specific type, regardless of the message headers. |
Remarks
Multiple calls to this methods will cause multiple consumers to be instantiated, which means multiple connections being issues and more resources being used. The KafkaConsumerEndpoint allows to define multiple topics to be consumed, to efficiently instantiate a single consumer for all of them.
AddOutbound(Type, RouterFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound(Type messageType, DictionaryOutboundRouter<object, KafkaProducerEndpoint>.RouterFunction routerFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the messages to be published to this endpoint. |
DictionaryOutboundRouter<object, KafkaProducerEndpoint>.RouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction. |
IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> | endpointBuilderActions | The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
AddOutbound(Type, SingleEndpointRouterFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound(Type messageType, DictionaryOutboundRouter<object, KafkaProducerEndpoint>.SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the messages to be published to this endpoint. |
DictionaryOutboundRouter<object, KafkaProducerEndpoint>.SingleEndpointRouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction. |
IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> | endpointBuilderActions | The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
AddOutbound(Type, Action<IKafkaProducerEndpointBuilder>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound(Type messageType, Action<IKafkaProducerEndpointBuilder> endpointBuilderAction, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
Type | messageType | The type of the messages to be published to this endpoint. |
Action<IKafkaProducerEndpointBuilder> | endpointBuilderAction | An Action<T> that takes the IKafkaProducerEndpointBuilder and configures it. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
AddOutbound<TMessage>(RouterFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound<TMessage>(DictionaryOutboundRouter<TMessage, KafkaProducerEndpoint>.RouterFunction routerFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
DictionaryOutboundRouter<TMessage, KafkaProducerEndpoint>.RouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.RouterFunction. |
IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> | endpointBuilderActions | The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be published to this endpoint. |
AddOutbound<TMessage>(SingleEndpointRouterFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound<TMessage>(DictionaryOutboundRouter<TMessage, KafkaProducerEndpoint>.SingleEndpointRouterFunction routerFunction, IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> endpointBuilderActions, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
DictionaryOutboundRouter<TMessage, KafkaProducerEndpoint>.SingleEndpointRouterFunction | routerFunction | The DictionaryOutboundRouter<TMessage, TEndpoint>.SingleEndpointRouterFunction. |
IReadOnlyDictionary<string, Action<IKafkaProducerEndpointBuilder>> | endpointBuilderActions | The IReadOnlyDictionary<TKey, TValue> containing the key of each endpoint and the Action<T> to be invoked to build them. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be published to this endpoint. |
AddOutbound<TMessage>(Action<IKafkaProducerEndpointBuilder>, bool)
Adds an outbound endpoint to produce the specified message type to a Kafka topic.
Declaration
IKafkaEndpointsConfigurationBuilder AddOutbound<TMessage>(Action<IKafkaProducerEndpointBuilder> endpointBuilderAction, bool preloadProducers = true)
Parameters
Type | Name | Description |
---|---|---|
Action<IKafkaProducerEndpointBuilder> | endpointBuilderAction | An Action<T> that takes the IKafkaProducerEndpointBuilder and configures it. |
bool | preloadProducers | Specifies whether the producers must be immediately instantiated and connected. When |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
TMessage | The type of the messages to be published to this endpoint. |
Configure(Action<KafkaClientConfig>)
Configures the Kafka client properties that are shared between the producers and consumers.
Declaration
IKafkaEndpointsConfigurationBuilder Configure(Action<KafkaClientConfig> configAction)
Parameters
Type | Name | Description |
---|---|---|
Action<KafkaClientConfig> | configAction | An Action<T> that takes the KafkaClientConfig and configures it. |
Returns
Type | Description |
---|---|
IKafkaEndpointsConfigurationBuilder | The IKafkaEndpointsConfigurationBuilder so that additional calls can be chained. |