![]() |
VOOZH | about |
dotnet add package PiBox.Plugins.Messaging.Kafka.Flow --version 1.1.2
NuGet\Install-Package PiBox.Plugins.Messaging.Kafka.Flow -Version 1.1.2
<PackageReference Include="PiBox.Plugins.Messaging.Kafka.Flow" Version="1.1.2" />
<PackageVersion Include="PiBox.Plugins.Messaging.Kafka.Flow" Version="1.1.2" />Directory.Packages.props
<PackageReference Include="PiBox.Plugins.Messaging.Kafka.Flow" />Project file
paket add PiBox.Plugins.Messaging.Kafka.Flow --version 1.1.2
#r "nuget: PiBox.Plugins.Messaging.Kafka.Flow, 1.1.2"
#:package PiBox.Plugins.Messaging.Kafka.Flow@1.1.2
#addin nuget:?package=PiBox.Plugins.Messaging.Kafka.Flow&version=1.1.2Install as a Cake Addin
#tool nuget:?package=PiBox.Plugins.Messaging.Kafka.Flow&version=1.1.2Install as a Cake Tool
This plugin provides the nuget packages from KafkaFlow as Pibox plugin.
The containers that you need are also provided in the docker-compose.yaml file. You just need to configure the consumer(
Install the Plugin via Nuget
dotnet add package PiBox.Plugins.Messaging.Kafka.Flow
or add as package reference to your .csproj
<PackageReference Include="PiBox.Plugins.Messaging.Kafka.Flow" Version=""/>
Configure your appsettings.yml accordingly.
kafka:
client:
bootstrapServers: "localhost:9092,localhost:9093"
# securityProtocol: "SaslPlaintext"
# saslPassword: "asdf"
# saslUsername: "asdf"
# saslMechanism: "Plain"
# sslCaLocation: ""
# enableSslCertificateVerification: "false"
schemaRegistry:
url: "localhost:8081"
# basicAuthUserInfo: "developer:SECRET"
# enableSslCertificateVerification: "false"
The docker-compose.yaml will run the following containers:
To run all containers
docker-compose up
To stop and remove the currently running containers
docker-compose down
public class KafkaFlowExamplePlugin : IPluginServiceConfiguration
{
private readonly IConfiguration _configuration;
private readonly ILogger? _logger;
public KafkaFlowExamplePlugin(IConfiguration configuration, ILogger<KafkaFlowExamplePlugin>? logger)
{
_configuration = configuration;
_logger = logger;
}
//Configure your consumers & producers
public void ConfigureServices(IServiceCollection serviceCollection)
{
serviceCollection.ConfigureKafka(_configuration, _logger, kafkaFlowBuilder => kafkaFlowBuilder
//possible configurations:
// producerConfig is none
// producer is added to a Dictionary<Type, Action<IProducerConfigurationBuilder>>
// type is typeof(TMessage)
.AddTypedProducer<TMessage>("protobuf-topic")
// producer is added to a Dictionary<Type, Action<IProducerConfigurationBuilder>>
// type is typeof(TMessage)
.AddTypedProducer<TMessage>("protobuf-topic", producerConfig)
// producerConfig is none
// producer is added to a List<(string, Action<IProducerConfigurationBuilder>)
// the string added is typeof(TProducer).Name
.AddProducer<TProducer>("protobuf-topic")
// producer is added to a List<(string, Action<IProducerConfigurationBuilder>)
// the string added is typeof(TProducer).Name
.AddProducer<TProducer>("protobuf-topic", producerConfig)
// consumer is added to a List<Action<IConsumerConfigurationBuilder>>
.AddConsumer<TMessageHandler>("protobuf-topic", "mygroup"));
// consumer is added to a List<Action<IConsumerConfigurationBuilder>>
// dead letter message is produced on dead letter topic in case of unsuccessful processing of the message
.AddConsumerWithDeadLetter<TMessageHandler, TMessage, TDeadLetterMessage>("protobuf-topic", "dead-letter-topic", "mygroup")
}
}
Click here to read more about the IServiceCollection interface.
syntax = "proto3";
message TMessage {
string Message = 1;
int32 Code = 2;
}
Click here to read more about protobuf
public class ProtobufMessageHandler : IMessageHandler<ProtobufLogMessage>
{
public Task Handle(IMessageContext context, ProtobufLogMessage message)
{
// Do something
}
}
// The DltMessageHandler inherits from IMessageHandler<TMessage> (used to create a message handler)
// It also produces a dead letter message if there was an exception in ProcessMessageAsync
public class ProtobufDltMessageHandler : DltMessageHandler<TMessage, TDeadLetterMessage>
{
protected override async Task ProcessMessageAsync(IMessageContext context, TMessage message)
{
// Do something
}
protected override TDeadLetterMessage HandleError(IMessageContext context, TMessage message, Error error)
{
// Do something
}
}
public class SampleProducer
{
private readonly IMessageProducer _producer;
public SampleProducer(IProducerAccessor producerAccessor)
{
_producer = producerAccessor.GetProducer("TProducer");
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
_producer.ProduceAsync("protobuf-topic", messageKey, messageValue);
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.2 | 266 | 2/4/2025 |
| 1.0.91 | 214 | 1/24/2025 |
| 1.0.85 | 209 | 1/15/2025 |
| 1.0.79 | 229 | 12/20/2024 |
| 1.0.73 | 245 | 10/22/2024 |
| 1.0.66 | 207 | 10/15/2024 |
| 1.0.64 | 228 | 10/14/2024 |
| 1.0.61 | 218 | 10/1/2024 |
| 1.0.60 | 223 | 9/27/2024 |
| 1.0.54 | 292 | 4/30/2024 |
| 1.0.51 | 244 | 2/27/2024 |
| 1.0.49 | 234 | 2/27/2024 |
| 1.0.47 | 251 | 2/21/2024 |
| 1.0.45 | 273 | 2/20/2024 |
| 1.0.43 | 248 | 2/13/2024 |
| 1.0.41 | 251 | 2/13/2024 |
| 1.0.39 | 254 | 2/8/2024 |
| 1.0.38 | 267 | 2/8/2024 |
| 1.0.6 | 229 | 2/4/2025 |
| 1.0.4 | 217 | 2/4/2025 |