Skip to content

v3.0.0-rc.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 May 22:08
· 17 commits to master since this release

Project Logo

ModernDiskQueue v3.0.0-rc.4

✨Highlights

This release is all about improving support for serialization strategies

  • For typed queues, you can now select from two built-in serializers - the new JSON serializer using System.Text.Json.JsonSerializer or the original XML serializer based on System.Runtime.Serialization.DataContractSerializer.
  • It's easier to specify your default serialization strategy:
    • At queue-creation, a default serialization strategy can be specified which will be used by all sessions created for that queue.
    • At session-creation, the strategy can be passed in via the .OpenSessionAsync overloads.
    • Built-in strategies can be specified using their ISerializationStrategy<T> implementations, SerializationStrategyXml<T> and SerializationStrategyJson<T>, or with a new enum, SerializationStrategy.Xml and SerializationStrategy.Json.
  • The XML serializer remains the default for backward compatibility.
  • New projects should strongly consider using the JSON serializer.
    • The JSON serializer produces significantly smaller data files on disk.
    • Source-generated serialization can be used. It's easy and results in significantly better performance than reflection-based serialization.
  • Implementation of ISerializationStrategy<T> can be made easier by inheriting from either of two base classes, SyncSerializationStrategyBase or AsyncSerializationStrategyBase.
  • Significant build-out of the README.md file to include expanded examples and ** more comprehensive documentation**.
  • Expanded test coverage: Added unit tests for all new features and behaviors with serialization strategies.
  • Benchmarking project: Includes a new benchmark to compare data file size on disk when using different ISerializationStrategy<T> implementations.

✌️ Compatibility

  • The original synchronous API is fully preserved from DiskQueue, allowing drop-in replacement for most scenarios, with the following migration caveats:
    • If you have custom implementations of ISerializationStrategy<T>, change them to inherit from SyncSerializationStrategyBase.
    • If you are using the implementation interfaces (IFileDriver, IBinaryReader, etc), include the new namespace in your using statements. The implementation interfaces have been moved to the ModernDiskQueue.Implementation.Interfaces namespace.
    • If you directly reference DefaultSerializationStrategy<T>, this class has been replaced with SerializationStrategyXml<T>.
    • These transition requirements are documented in the Migrating from DiskQueue section of the README file.

Note: Do not invoke async and sync API usage on the same queue objects.

⚠️ Breaking Changes from v2

  • Namespaces for the built-in default serialization strategy and ISerializationStrategy<T> have changed.
  • Namespace for the registration helper has moved from ModernDiskQueue.DependencyInjection to the root namespace, ModernDiskQueue.
  • Advanced Scenarios: Namespaces have been made more consistent for internal interfaces.

For migration guidance, usage examples, and more details on the async API, see the README file.