Skip to content

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 13:18
· 115 commits to main since this release

Settling the contracts that 1.0 will freeze. COMPATIBILITY.md now names the data and wire formats a rolling upgrade depends on and what each kind of release may change on the platform, and drafts the 1.0 freeze checklist. Data that 0.10.0 wrote is read and written back the same way by tests, including the idempotency and rate-limit keys. Two behavior changes need attention when upgrading: the default scope of @Idempotent and @RateLimit, which changes their Redis keys, and cancellation while waiting for a lock. Projections converge in one more failure case and refresh right after the commit on MySQL, an application's cache invalidation publisher replaces DDK's, and ddk-example-user runs as a GraalVM native image in CI. The upgrade and the rollback were rehearsed with 0.10 and 0.11 instances side by side; the upgrade guide lists the steps.

Breaking

  • The default scope of @Idempotent and @RateLimit names parameter types in full: com.acme.OrderService#place(com.acme.PlaceOrderCommand) instead of ...#place(PlaceOrderCommand). Overloads whose parameter types share a simple name, such as submit(java.util.Date) and submit(java.sql.Date), used to share registrations and rate limits. The Redis keys change. For as long as old and new instances run side by side, they keep separate registrations and separate rate-limit quotas: a request registered by one version is not recognized as a duplicate by the other, and each version counts its own calls up to the limit. After the last old instance has stopped, a retry of a request that it registered still runs on the new version until that registration expires, at most one TTL later. Rolling back reads the old keys again, so registrations and counts that the old version wrote and that have not expired yet apply again. To keep the old keys, set scope on the annotation to the old value; the key stays the same only while the key prefix, the value of the key expression and, for @RateLimit, limit and period stay the same too
  • AggregateLocks and @AggregateLock throw CancellationException when the thread is interrupted while it waits for a lock, and keep the interrupt flag; the action does not run. They used to throw AggregateBusyException, which the web starter answers with 409, so an operation cancelled during shutdown or by cancelling its task was reported as a conflict to retry. To migrate: code that caught AggregateBusyException to retry does not catch the cancellation, and should not retry it as if the lock were busy; a task that is cancelled ends with CancellationException and its thread stays interrupted. Through BaseExceptionHandler the request now gets 500 with SYSTEM_ERROR. An application that prefers 503 adds its own @ExceptionHandler(CancellationException.class) returning ApiResponse.ofFail(CommonError.SYSTEM_ERROR) with that status

Added

  • GraalVM native images, verified module by module: ddk-mybatis-starter registers the reflection that MyBatis-Plus and the default snowflake ID generator need, and CI builds ddk-example-user as a native image and smoke-tests it. ddk-core, ddk-mybatis, the web, MyBatis and MCP starters, and in-application domain events are verified; SUPPORT.md lists the rest

Changed

  • The three projection gauges (ddk.projection.pending, failing, oldest.age) share one scan of the pending table per scrape instead of three, reused for a second. With a backlog of one million marks the scrape cost on MySQL 8.4 dropped from about 1.75 s to about 0.5 s

Fixed

  • Projections converge when a refresh writes after losing its claim and then fails, for example when an external write went through but its response was lost. The failure used to release the claim without marking the entry again, so the read model could keep the stale snapshot with no mark left. Now any acknowledgement or failure from a worker that no longer owns the mark leaves a mark behind; a mark that still exists only gets a new generation, which keeps the attempts and back-off of the worker that holds it
  • On MySQL, a projection refresh starts right after the commit, instead of sometimes waiting for the next sweep (30 s by default). The pending table stores available_at without fractional seconds, and MySQL rounds them on insert, so a mark written in the second half of a second was due only in the next second and the wake-up after the commit did not see it. Marks are now written due at the start of their second. H2 and PostgreSQL were not affected
  • An application's own CacheInvalidationPublisher replaces the Redis one without failing startup. The Redis listener container used to require DDK's internal publisher, so a replacement made the context fail when Redis was present and a cache used its local level. DDK now subscribes to its channel only when it also publishes on it