- Removed
SerializationContextfrom non-async serde interfaces. - Replaced
ISerializerinterface withSerializerdelegate. - Replaced
IDeserializerinterface withDeserializerdelegate.
Producer.Pollcan now be used with producer instances that are in background polling mode.- Typically use: Block for a minimal period of time following a
ErrorCode.Local_QueueFullerror.
- Typically use: Block for a minimal period of time following a
- Removed the
Confluent.Kafka.Serdesnamespace.
- Added
CompressionTypeproperty toProducerConfigclass.
- References librdkafka.redist v1.0.0
- Moved API docs from the client classes to their respective interfaces.
- Update formatting of client API docs so they display well in Visual Studio Code intellisense.
- Added GET subject versions to the cached schema registry client.
- References librdkafka.redist 1.0.0-RC9
- supports apline linux out-of-the-box.
- fallback support (that excludes security features) for most linux distributions previously unsuppored out-of-the-box.
- fixed a dependency issue on MacOS
- A new rebalance API.
SetRebalanceHandlerhas been split intoSetPartitionsAssignedHandlerandSetPartitionsRevokedHandler.- Calling of
Assign/Unassignin these handlers is prohibited. - Partitions to read from / start offsets can be optionally specified manually via the return value from these handlers.
- The
Message.PersistenceStatusproperty name has changed toMessage.Status. - Moved the
GetWatermarkOffsetsandQueryWatermarkOffsetsmethods from admin client to consumer. - Context is now provided to serdes via a
SerializationContextclass instance.
- Corrected an error in the
rd_kafka_event_typemethod signature which was causing incompatibility with mono. - Audited exception use across the library and made changes in various places where appropriate.
- Removed unused
CancellationTokenparameters (we will add them back when implemented). - Builder classes now return interfaces, not concrete classes.
- Removed the dependency on
CompilerServices.Unsafewhich was causingProduceAsyncto hang in some scenarios. - Fixed a deadlock-on-dispose issue in
AdminClient. - Made
Producer.ProduceAsyncasync.
- Revamped producer and consumer serialization functionality.
- There are now two types of serializer and deserializer:
ISerializer<T>/IAsyncSerializer<T>andIDeserializer<T>/IAsyncDeserializer<T>.ISerializer<T>/IDeserializer<T>are appropriate for most use cases.IAsyncSerializer<T>/IAsyncDeserializer<T>are async friendly, but less performant (they returnTasks).
- Changed the name of
Confluent.Kafka.AvrotoConfluent.SchemaRegistry.Serdes(Schema Registry may support other serialization formats in the future). - Added an example demonstrating working with protobuf serialized data.
- There are now two types of serializer and deserializer:
Consumers,Producers andAdminClients are now constructed using builder classes.- This is more verbose, but provides a sufficiently flexible and future proof API for specifying serdes and other configuration information.
- All
events on the client classes have been replaced with correspondingSet...Handlermethods on the builder classes.- This allows (enforces) handlers are set on librdkafka initialization (which is important for some handlers, particularly the log handler).
events allow for more than one handler to be set, but this is often not appropriate (e.g.OnPartitionsAssigned), and never necessary. This is no longer possible.events are also not async friendly (handlers can't returnTask). The Set...Handler appropach can be extend in such a way that it is.
- Avro serdes no longer make blocking calls to
ICachedSchemaRegistryClient- everything isawaited.- Note: The
Consumerimplementation still calls async deserializers synchronously because theConsumerAPI is still otherwise fully synchronous.
- Note: The
- Reference librdkafka.redist 1.0.0-RC7
- Notable features: idempotent producer, sparse connections, KIP-62 (max.poll.interval.ms).
- Note: End of partition notification is now disabled by default (enable using the
EnablePartitionEofconfig property).
- Removed the
Consumer.OnPartitionEOFevent in favor notifying of partition eof viaConsumeResult.IsPartitionEOF. - Removed
ErrorEventclass and addedIsFataltoErrorclass.- The
IsFatalflag is now set appropriately for all errors (previously it was always set tofalse).
- The
- Added
PersistenceStatusproperty toDeliveryResult, which provides information on the persitence status of the message.
- Added
Closemethod toIConsumerinterface. - Changed the name of
ProduceException.DeliveryReporttoProduceException.DeliveryResult. - Fixed bug where enum config property couldn't be read after setting it.
- Added
SchemaRegistryBasicAuthCredentialsSourceback intoSchemaRegistryConfig(#679). - Fixed schema registry client failover connection issue (#737).
- Improvements to librdkafka dependnecy discovery (#743).
- References librdkafka 1.0.0-PRE1. Highlights:
- Idempotent producer.
- Sparse connections (broker connections are only held open when in use).
- Fixed a memory leak in
ProduceAsync#640 (regression from 0.11.x).
- Added an AdminClient, providing
CreateTopics,DeleteTopics,CreatePartitions,DescribeConfigsandAlterConfigs. - Can now produce / consume message headers.
- Can now produce user defined timestamps.
- Added
IClient,IProducerandIConsumerinterfaces (useful for dependency injection and mocking when writing tests). - Added a
Handleproperty to all clients classes:- Producers can utilize the underlying librdkafka handle from other Producers (replaces the 0.11.x
GetSerializingProducermethod on theProducerclass). AdminClientcan utilize the underlying librdkafka handle from otherAdminClients,Producers orConsumers.
- Producers can utilize the underlying librdkafka handle from other Producers (replaces the 0.11.x
IDeserializernow exposes message data viaReadOnlySpan<byte>, directly referencing librdkafka allocated memory. This results in a considerable (up to 2x) performance increase and reduced memory.- Most blocking operations now accept a
CancellationTokenparameter.- TODO: in some cases there is no backing implementation yet.
- .NET Specific configuration parameters are all specified/documented in the
ConfigPropertyNamesclass.
- The
Messageclass has been re-purposed and now encapsulates specifically the message payload only.ProduceAsync/BeginProducenow return aDeliveryReportobject andConsumer.Consumereturns aConsumeResultobject.
- The methods used to produce messages have changed:
- Methods that accept a callback are now named
BeginProduce(notProduceAsync), analogous to similar methods in the standard library. - Callbacks are now specified as
Action<DeliveryReportResult<TKey, TValue>>delegates, not implementations ofIDeliveryHandler. - The
IDeliveryHandlerinterface has been depreciated. - There are two variants of
ProduceAsyncandBeginProduce, the first takes a topic name and aMessage. The second takes aTopicPartitionand a message.- i.e. when producing, there is now clear separation between what is produced and where it is produced to.
- The new API is more future proof.
ProduceAsyncnow callsSetExceptioninstead ofSetResulton the returnedTask, making error checking more convenient and less prone to developer mistakes.
- Methods that accept a callback are now named
- The feature to block
ProduceAsynccalls on local queue full has been removed (result inLocal_QueueFullerror). This should be implemented at the application layer if required. - The non-serializing
Producerand non-deserializingConsumertypes have been removed (use generic types withbyte[]instead), considerably reducing API surface area. - The
ISerializingProducerinterface has been removed - you can achieve the same functionality by sharing client handles instead. - The
Consumer.Pollmethod and correspondingOnMessageevent have been removed. You should useConsumer.Consumeinstead. - The
Consumer.OnConsumeErrorhas been removed. Consume errors are now exposed via aConsumeException. - The
Consumer.Consumemethod now returns aConsumeResultobject, rather than aMessagevia an out parameter. CommitAsynchas been removed (useCommitinstead).Commiterrors are reported via an exception and method return values have correspondingly changed.ListGroups,ListGroup,GetWatermarkOffsets,QueryWatermarkOffsets, andGetMetadatahave been removed fromProducerandConsumerand exposed only viaAdminClient.- Added
Consumer.Close. - Various methods that formerly returned
TopicPartitionOffsetError/TopicPartitionErrornow returnTopicPartitionOffset/TopicPartitionand throw an exception in case of error (with aResultproperty of typeTopicPartitionOffsetError/TopicPartitionError).
- Removed cast from
Errortobool. Consumer.OffsetsForTimesif provided an empty collection will return an empty collection (not throw an exception).manualPollargument has been removed from theProducerconstructor and is now a configuration option.enableDeliveryReportsargument has been removed from theProducerconstructor and is now a configuration option.- Removed methods with a
millisecondsTimeoutparameter (always preferring aTimeSpanparameter). - Added
Consumer.Consumevariants with aCancellationTokenparameter. - Added A
Producer.Flushmethod variant without a timeout parameter (but with aCancellationTokenparameter that is observed). - Added the
SyslogLevelenumeration, which is used by the log handler delegate.
- When delivery reports are disabled,
ProduceAsyncwill return completedTasks rather thanTasks that will never complete. - Avro serializers / deserializer now handle
nullvalues. - Examples upgraded to target 2.1.
- Changed name of
HasErrortoIsError - Configuration options have been added to allow fine-grained control over of marshalling of values to/from librdkafka (for high performance usage).
- headers, message keys and values, timestamps and the topic name.
- Improved XML API documentation.
refer to the release notes