Kafka Events
The underlying library (Confluent.Kafka) uses some events to let you catch important information, interact with the partitions assignment process, etc.
Silverback proxies those events to give you full access to those features.
Consumer events
These callbacks are available:
- IKafka
Partitions Assigned Callback - IKafka
Partitions Revoked Callback - IKafka
Offset Committed Callback - IKafka
Consumer Error Callback - IKafka
Consumer Statistics Callback - IKafka
Consumer Log Callback - IKafka
Partition Eof Callback
Offset reset example
In the following example the partitions assigned event is subscribed in order to reset the start offsets and replay the past messages.
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddSilverback()
.WithConnectionToMessageBroker(options => options
.AddKafka())
.AddSingletonBrokerCallbackHandler<ResetOffsetPartitionsAssignedCallbackHandler>();
}
}
Producer events
These callbacks are available: