-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added migration guide from v2 to v3
- Loading branch information
1 parent
c9f6244
commit 01fc6f6
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
website/docs/guides/migration-guides/migrating-from-v2-to-v3.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# KafkaFlow v2 to v3 Migration Guide | ||
|
||
## Overview | ||
|
||
KafkaFlow version 3 brings several significant changes and improvements. This guide will help you navigate through the migration process from version 2 to version 3. | ||
|
||
## 1. Update to Target Framework to .NET 6 | ||
|
||
- The Target Framework from the library was updated from .NET 3.1 to .NET 6. | ||
|
||
## 2. UI Dashboard URL Change | ||
|
||
- The UI Dashboard URL has changed from `/kafka-flow` to `/kafkaflow`. Update any bookmarks or references accordingly. | ||
|
||
## 3. Remove Packages and Core Changes | ||
|
||
### 3.1 Removed Packages | ||
|
||
- The following packages were removed from external dependencies and are now part of the library core: | ||
- TypedHandler | ||
- Compression | ||
- Serializer | ||
- BatchConsumer | ||
|
||
### 3.2 Segregated Interfaces | ||
|
||
#### ISerializer and IDeserializer Interfaces | ||
|
||
- Consumer serialization Middleware configuration renamed from `.AddSerializer()` to `.AddDeserializer()`. | ||
- Created `IDeserializer` interface with `.DeserializeAsync()` method. | ||
|
||
##### ProtobufNetSerializer Changes | ||
|
||
- Moved `.DeserializeAsync()` from `ProtobufNetSerializer` to newly created `ProtobufNetDeserializer` with `.DeserializeAsync()` method. | ||
|
||
##### ConfluentAvroSerializer Changes | ||
|
||
- Moved `.DeserializeAsync()` from `ConfluentAvroSerializer` to newly created `ConfluentAvroDeserializer` with `.DeserializeAsync()` method. | ||
|
||
##### NewtonsoftJsonSerializer Changes | ||
|
||
- Moved `.DeserializeAsync()` from `NewtonsoftJsonSerializer` to newly created `NewtonsoftJsonDeserializer` with `.DeserializeAsync()` method. | ||
|
||
##### ConfluentJsonSerializer Changes | ||
|
||
- Moved `.DeserializeAsync()` from `ConfluentJsonSerializer` to newly created `ConfluentJsonDeserializer` with `.DeserializeAsync()` method. | ||
|
||
##### ConfluentProtobufSerializer Changes | ||
|
||
- Moved `.DeserializeAsync()` from `ConfluentProtobufSerializer` to newly created `ConfluentProtobufDeserializer` with `.DeserializeAsync()` method. | ||
|
||
#### ICompressor and IDecompressor Interfaces | ||
|
||
- Consumer compressor middleware configuration `.AddCompressor()` renamed to `.AddDecompressor()`. | ||
- Created `IDecompressor` interface that exposes a `.Decompress()` method. | ||
|
||
### 3.3 Consumer Batching Configuration | ||
|
||
- Consumer batching configuration renamed from `.BatchConsume()` to `.AddBatching()`. Update your configuration accordingly. | ||
|
||
## 4. Async Support for Message Type Resolvers and Schema Registry Resolvers | ||
|
||
### 4.1 ISchemaRegistryTypeNameResolver | ||
|
||
- `ISchemaRegistryTypeNameResolver.Resolve()` renamed to `ISchemaRegistryTypeNameResolver.ResolveAsync()`. Ensure your implementation is updated to the new signature. | ||
|
||
### 4.2 IMessageTypeResolver | ||
|
||
- `IMessageTypeResolver.OnConsume()` renamed to `IMessageTypeResolver.OnConsumeAsync()`. | ||
- `IMessageTypeResolver.OnProduce()` renamed to `IMessageTypeResolver.OnProduceAsync()`. Update your message type resolver implementations accordingly. | ||
|
||
## 5. Improved Worker Distribution Strategy | ||
|
||
- `IDistributionStrategy` interface renamed to `IWorkerDistributionStrategy`. | ||
- `IWorkerDistributionStrategy` now receives a `WorkerDistributionStrategy` with more context to decide how to distribute to workers. Review and adjust your worker distribution strategy implementations. | ||
|
||
## 6. Dynamic Workers Calculation Feature | ||
|
||
### 6.1 Improved Mechanism for Signalling Message Processing Completion | ||
|
||
- New mechanisms have been introduced to signal the completion of message processing. | ||
|
||
### 6.2 Expose Worker Events to Client Applications | ||
|
||
- Events related to worker activities are now exposed to client applications. | ||
|
||
### 6.3 Dynamic Worker Pool Scaling | ||
|
||
- A new feature allows the dynamic calculation of how many workers are needed to handle consumed messages. | ||
|
||
### 6.4 Consumer Configuration Changes | ||
|
||
- Added `.WithWorkersCount(Func<WorkersCountContext, IDependencyResolver, Task<int>> calculator)` to consumer configuration. Implement this method to dynamically calculate the number of workers. | ||
- `IConsumerConfigurationBuilder.WithManualStoreOffsets` renamed to `IConsumerConfigurationBuilder.WithManualMessageCompletion`. Update your consumer configurations accordingly. | ||
|
||
## Conclusion | ||
|
||
Please ensure you review and adapt your codebase according to these changes. If you encounter any issues or need assistance, feel free to reach out to the KafkaFlow community. Thank you for using KafkaFlow! |