Releases: confluentinc/confluent-kafka-dotnet
Releases · confluentinc/confluent-kafka-dotnet
v1.0.0-RC7
- Moved SyncOverAsync functionality to the Confluent.Kafka.SyncOverAsync namespace.
- Marked DependentProducerBuilder as API-SUBJECT-TO-CHANGE.
- No-op handlers are no longer registered with librdkafka if corresponding handlers are not specified in client builder classes.
- Renamed AsyncAvroSerializer to AvroSerializer and AsyncAvroDeserializer to AvroDeserializer
v1.0-RC6
New Features
- Added DependentAdminClientBuilder class.
Changes
- Reverted RC4 changes.
- Renamed AvroSerializer to AsyncAvroSerializer and AvroDeserializer to AsyncAvroDeserializer
- Added SyncOverAsyncSerializer and SyncOverAsyncDeserializer adapter classes.
- Added AsSyncOverAsync factory method to AsyncAvroSerializer and AsyncAvroDeserializer.
- Removed IAsyncDeserializer setter overloads from the ConsumerBuilder class.
- Renamed Producer.BeginProduce to Producer.Produce.
- Produce throws an exception if used when async serializers are configured.
- Made AdminClient, Producer, and Consumer classes internal.
v1.0-RC4
v1.0-RC3
New Features
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
Changes
- Removed the
Confluent.Kafka.Serdesnamespace.
Fixes
- Added
CompressionTypeproperty toProducerConfigclass.
v1.0-RC2
v1.0-RC1
New Features
- 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
Changes
- 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. - All errors (that don't correspond to application logic errors) that occur as the result of a call to the produce and consume methods are now reported via exceptions of type ProduceException and ConsumeException.
Fixes
- 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. - Fixed deadlock in BeginProduce and Consume when using async serdes in a single threaded context.
v1.0-beta3
New Features
- 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.
Fixes
- 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).
v1.0-beta2
New Features
- References librdkafka 1.0.0-PRE1. Highlights:
- Idempotent producer.
- Sparse connections (broker connections are only held open when in use).
Enhancements / Fixes
- Fixed a memory leak in
ProduceAsync#640 (regression from 0.11.x).
v1.0-beta
New Features
- 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 strongly typed configuration classes.
- 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 considerable (up to 2x) performance 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.
Major Breaking API Changes
- 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<DeliveryReport<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 useConsumerorConsumerAsyncinstead. - The
Consumer.OnPartitionEOFevent has been removed. You should inspect theConsumeResultinstance returned fromConsumer.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. - Added
Consumer.ConsumeAsyncmethods.- TODO: this is not finalized. there is an ongoing discussion relating to rebalence semantics.
CommitAsyncerrors are now reported via an exception and method return values have correspondingly changed.ListGroups,ListGroup,GetWatermarkOffsets,QueryWatermarkOffsets, andGetMetadatahave been removed fromProducerandConsumerand exposed only viaAdminClient.- TODO: these method signatures need work / extra capability and will be depreciated. we should try to update before 1.0.
- Added
Consumer.Closeand theConsumer.Disposemethod no longer blocks.- TODO: yes it does! this needs fixing.
- Log handlers are now specified via configuration properties, not
OnLoghandlers. This allows logging to be enabled during client construction. - Various methods that formerly returned
TopicPartitionOffsetError/TopicPartitionErrornow returnTopicPartitionOffset/TopicPartitionand throw an exception in
case of error (with aResultproperty of typeTopicPartitionOffsetError/TopicPartitionError).
Minor Breaking API Changes
- 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
ConsumeandConsumeAsyncvariants without a timeout parameter (but with aCancellationTokenparameter that is observed). - 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.
Minor Enhancements / Fixes
- 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.
v0.11.5
Maintenance Release
- References librdkafka version 0.11.5, inheriting associated bug fixes. For more information refer to https://github.com/edenhill/librdkafka/releases/tag/v0.11.5
- The Avro generic serializer now works with multiple topics (thanks @NikolayDekov).
- Fixed a GC cleanup ordering issue during client finalization.
- CentOS 7 compatibility out of the box.
Note: we are no longer adding features to the 0.11.x branches of the .NET Client (but will continue to do maintenance releases for the foreseeable future). All new feature work is being directed towards the upcoming 1.0 release, which contains breaking API changes.