Repository navigation
0.40.25
Pre-release
Pre-release
Essentials v0.40.25 Release Notes
Overview
This release introduces significant enhancements to durable queues with intelligent polling optimization and major SQL query performance improvements, experimental event sourcing improvements, enhanced security features, and comprehensive documentation updates.
The release focuses on performance optimization and developer experience improvements, with large performance gains in DurableQueue operations through new query optimizations.
🚀 New Features
Durable Queues Optimization
CentralizedQueuePollingOptimizer
- New intelligent polling backoff system for
CentralizedMessageFetcher - Configurable parameters:
initialDelayMs: Base delay after seeing work (e.g., 100ms)maxDelayMs: Maximum backoff cap (e.g., 30,000ms)backoffFactor: Multiplier on empty polls (e.g., 2.0)jitterFraction: ±fraction for jitter (e.g., 0.1 = ±10%)
- Benefits: Reduces resource consumption by intelligently backing off polling for queues that are empty and experience little activity
- Thread-safe implementation with atomic operations for concurrent environments
Enhanced Queue Consumer
- Improved durability and logging in queue consumer operations
- New
GetNextMessageReadyForDeliverySQL query that optimizes time and resources - Refactored
SimpleQueuePollingOptimizerinto its own top-level class for better maintainability
DurableQueue SQL Query Optimizations
- 🚀 Large Performance Improvements: New query optimizations addressing reported
DurableQueueperformance issues. More improvements will follow in the next releases. - New
useOrderedUnorderedQueryflag: Activates optimized SQL queries for significantly better performance- Default:
true(enabled by default for optimal performance) - Configuration:
essentials.durable-queues.use-ordered-unordered-query=true
- Default:
- New Spring Boot DurableQueues Configuration:
essentials.durable-queues.use-centralized-message-fetcher=true (default) - added in version 0.40.24 essentials.durable-queues.centralized-message-fetcher-polling-interval=20ms (default) - added in version 0.40.25 essentials.durable-queues.centralized-polling-delay-back-off-factor=1.5 (default) - added in version 0.40.25 essentials.durable-queues.use-ordered-unordered-query=true (default) - added in version 0.40.25
📊 Performance Benchmarks
Large performance improvements with new query optimizations:
🎯 Performance Gains when using essentials.durable-queues.use-ordered-unordered-query=true
- Ordered workload: ~17x faster (94% improvement)
- Unordered workload: ~5x faster (79% improvement)
- Mixed workload: ~19x faster (95% improvement)
🎯 Decreased Database load when using the CentralizedQueuePollingOptimizer
- If
essentials.durable-queues.use-centralized-message-fetcher=truethen theCentralizedQueuePollingOptimizeris automatically configured. - Use the
essentials.durable-queues.centralized-message-fetcher-polling-interval,essentials.durable-queues.centralized-polling-delay-back-off-factorandessentials.durable-queues.max-polling-interval
to adjustCentralizedMessageFetcher'sinitialDelayMs,backoffFactorandmaxDelayMs
Inbox Enhancements
- Automatic UnitOfWork integration: If
Inboxhas access toUnitOfWorkFactory,addMessageReceivedcalls are automatically performed in aUnitOfWork - Improved transaction handling for message processing
PostgreSQL TTL Management
- 🆕 Time-to-Live (TTL) management feature for PostgreSQL databases
- Automatic cleanup of expired records based on configurable TTL policies
- Scheduling framework integration with PostgreSQL pg_cron support
- Flexible TTL configuration for different data types and retention requirements
Event Store Subscription Architecture Improvements
- Major refactoring of EventStoreSubscriptionManager (#14)
- Moved inner classes to top-level classes for better maintainability and testability:
AbstractEventStoreSubscription- Common functionality base classExclusiveAsynchronousSubscription- Dedicated class for exclusive async subscriptionsExclusiveInTransactionSubscription- Dedicated class for exclusive transactional subscriptionsNonExclusiveAsynchronousSubscription- Dedicated class for non-exclusive async subscriptionsNonExclusiveBatchedAsynchronousSubscription- Dedicated class for batched async subscriptionsNonExclusiveInTransactionSubscription- Dedicated class for non-exclusive transactional subscriptionsPersistedEventSubscriber- Dedicated subscriber interface
- Improved code organization and separation of concerns
- Enhanced maintainability with cleaner class hierarchy
Performance Monitoring Enhancements
- SQL execution time logger for database performance monitoring
- Query tagging features for better SQL query identification and debugging
- Enhanced observability of database operations
Kotlin Event Sourcing Enhancements
- Enhanced logging in
DeciderCommandHandlerAdapterwith detailed event information:- Aggregate type and ID
- Event type and order
- Global event order
Java Event Sourcing Enhancements
EventStreamDecider (Experimental)
⚠️ Experimental API - Subject to change in future releases- Simplified event sourcing interface focusing on processing commands against event streams
- Key characteristics:
- Event-centric: Works directly with event streams rather than maintaining state
- Functional: Pure functions with predictable input/output
- Idempotent: Safe to call multiple times with same input
- Stateless: No internal state management
- Perfect for Event Modeling and slicing implementation
- Supports Open/Closed Principle - only events are shared across slices
- Integration support via
EventStreamDeciderCommandHandlerAdapter - Testing framework with
GivenWhenThenScenariofor behavior-driven testing
Enhanced HandlerResult (related to Decider)
- New
foldmethod for functional-style result handling - Improved error handling and success case management
- Better integration with functional programming patterns
Security and Validation Enhancements
PostgresqlUtil Improvements
- More extensive SQL identifier validation supporting PostgreSQL naming conventions
- New or Updated
PostgresqlUtilvalidation methods:isValidSqlIdentifier(String): Validates basic SQL identifiersisValidQualifiedSqlIdentifier(String): Validates schema.table formatisValidFunctionName(String): Validates function namescheckIsValidTableOrColumnName(String): Validates table/column names
🛠️ API Improvements
EventJSON Enhancements
- New type-safe deserialization method:
deserialize(Class<T>)for improved flexibility and usability
Functional Enhancements
- New Quad-related functional utilities for working with 4-tuples
- Enhanced functional programming support
📚 Documentation Updates
Comprehensive README Updates
- Interceptor Pattern Support documentation with usage guidelines
- Code example corrections: Fixed logical type reference from
CURRENCY_CODEtoORDER_ID - Enhanced security documentation with detailed recommendations
- Improved Aggregate-Id documentation with security considerations
EventStreamDecider Documentation
- Detailed usage patterns and decision matrix for aggregate patterns
- Event Modeling integration guide
- Comprehensive examples and best practices
- Testing strategies with
GivenWhenThenScenario
Dependency Updates
Runtime Dependencies
- kotlin:
2.1.20→2.1.21 - spring-boot:
3.3.11→3.3.13 - spring-framework-bom:
6.1.19→6.1.21 - reactor-bom:
2023.0.17→2024.0.8 - spring-data-mongodb:
4.3.11→4.3.13 - spring-data-jpa:
3.3.11→3.3.13 - postgresql:
42.7.5→42.7.7 - log4j-to-slf4j:
2.24.3→2.25.1 - micrometer:
1.13.13→1.13.15 - micrometer-tracing:
1.3.11→1.3.13 - netty-bom:
4.2.0.Final→4.2.2.Final - xmlunit-core:
2.10.0→2.10.3
Test Dependencies
- junit-bom:
5.12.2→5.13.4 - testcontainers-bom:
1.21.0→1.21.3 - jdbi3-bom:
3.49.3→3.49.5 - jackson-bom:
2.19.0→2.19.2 - mockito-bom:
5.17.0→5.18.0
Maven Plugin Updates
- maven-clean-plugin:
3.4.1→3.5.0 - maven-enforcer-plugin:
3.5.0→3.6.1 - dependency-check-maven:
12.1.1→12.1.3 - flatten-maven-plugin:
1.7.0→1.7.2 - maven-gpg-plugin:
3.2.7→3.2.8
New Dependencies Added
- vaadin:
24.7.12(new dependency management) - spring.security:
6.3.10(new dependency management) - tomcat-embed:
10.1.43(new dependency management) - central-publishing-maven-plugin:
0.8.0(replaces nexus-staging-maven-plugin)
Pull Requests
- Introduce Essentials Api´s: by @lcramon-tw in #3
- queue_tracing by @jeppec in #4
- Vaadin UI by @lcramon-tw in #5
- Added a deprecated
AggregateTypeclass withdk.cloudcreatefor backward compatibility with existing persisted messages usingAggregateTypeas message payload (e.g.EventReferenceOrderedMessage). by @jeppec in #6 - Add Essentials Admin UI Spring Boot Starter by @lcramon-tw in #7
- Add scheduling framework with PostgreSQL pg_cron integration by @lcramon-tw in #8
- Add junit test summary step to github pipeline by @lcramon-tw in #12
- Add SQL execution time logger and query tagging features by @lcramon-tw in #11
- Introduce Time-to-Live (TTL) management feature for Postgresql in Essentials by @lcramon-tw in #10
- Refactor EventStoreSubscriptionManager moving inner classes to top level classes. Introducing AbstractEventStoreSubscription for common functionality. by @lcramon-tw in #14
- Introduce CentralizedQueuePollingOptimizer to add polling frequency backoff for CentralizedMessageFetcher. New GetNextMessageReadyForDelivery sql query that optimizes time and resources. by @lcramon-tw in #15
- Updated or Added the
<name>fields in allpom.xmlfiles. by @jeppec in #17
New Contributors
- @lcramon-tw made their first contribution in #3
Full Changelog: 0.40.24...0.40.25