Skip to content

v1.0.0-RC1

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 12 Nov 06:35
· 59 commits to main since this release

The first release candidate of 1.0. From 1.0 on, the contract in COMPATIBILITY.md holds: breaking changes only in a major release, checked by the API check against the last release and by the compatibility fixtures of every release since 0.10.0. Before the freeze, four things change that could not change afterwards: ddk-seata-starter is removed, ObjectMapper is renamed to BeanMapper, EnumMapper rejects an unknown value instead of returning null, and Operator becomes a final class with the same API. The MCP and tracer starters and the projection SPI are previews in 1.0 and may still change in a 1.x minor release. This candidate includes the security fixes of 0.12.1. It stays a candidate for at least four weeks, until two or three projects outside this repository have tried it; the upgrade guide lists the steps from 0.12, and reports go to the issue tracker.

Breaking

  • ddk-seata-starter is removed: it is no longer built or published, and ddk-dependencies no longer manages it or Seata. It was deprecated in 0.12.0; it had wiring tests only, Seata's runtime was never verified on Spring Boot 4, and global transactions go against the outbox and eventual consistency that DDK builds on. To keep using it, stay on ddk-seata-starter 0.12.0 and declare its version yourself, or copy its three classes (DdkSeataAutoConfiguration, DdkSeataProperties, XidPropagationInterceptor) into your project together with seata-spring-boot-starter
  • EnumMapper.toEnum throws IllegalArgumentException for a value that no constant of the enum has, naming the value, its type and the enum, instead of returning null. A null value still maps to null. Before, an aggregate loaded from a row with an unknown value got null in that field and failed somewhere else, or not at all. For a rolling upgrade this means: deploy the version that knows a new enum constant to every instance before anything writes its value. Values are compared with equals, so an INT column read as Integer does not match a getValue() that returns Long; that also fails now
  • com.ddk.core.mapper.ObjectMapper is renamed to BeanMapper, so that it no longer shares its name with Jackson's ObjectMapper; a class that used both had to spell one of them out in full. The methods are unchanged. Replace the import and the type name in your converters: implements ObjectMapper<Order, OrderPO> becomes implements BeanMapper<Order, OrderPO>. MapperProvider.lookup and GenericRepositoryImpl.toPo() and toEntity() return BeanMapper now
  • Operator is a final class instead of a record, so that 1.x can give it new properties, for example who acts on behalf of whom, without a breaking change: a record's canonical constructor and its deconstruction pattern are API, and one more component would break both. The constructor Operator(id, name, tenantId), of(...), id(), name(), tenantId(), equals, hashCode and toString stay as they were, so code that only creates and reads operators needs only a recompile. Code that deconstructs one, if (o instanceof Operator(var id, var name, var tenantId)), reads the accessors instead

Added

  • ddk.event.consume.failures{group}: how many times the longest failing RocketMQ queue of a consumer group has failed in a row. With orderly consumption, the default, a message that always fails holds up its queue without limit; the gauge keeps growing in that case, and from the tenth failure in a row the log entry is an error instead of a warning. The event starter's README lists the cases that fail every time

Changed

  • ddk-mybatis-starter logs a warning at startup when ddk.mybatis.worker-id and ddk.mybatis.datacenter-id are not both set. The derived snowflake identity comes from the MAC address and the process ID; in containers, where the process ID is usually 1, only 32 identities remain, and two of seven instances collide with a probability of about one half, which shows as a rare duplicate key on insert
  • DDK is built against the patch releases Spring Boot 4.1.2, Spring AI 2.0.2, MyBatis-Plus 3.5.18.1, Hutool 5.8.48 and Lombok 1.18.48, and ddk-dependencies manages Spring Modulith 2.1.2, springdoc 3.2.0 and okio 3.18.2. Spring Modulith 2.1.2 marks a publication as failed or resubmitted only while it is not completed, so a completed publication can no longer be resubmitted by mistake; publications that really failed are resubmitted as before

Fixed

  • The cache starter's README states two limits it did not mention: an eviction that fails while Redis is unreachable leaves the old value in Redis until the L2 TTL ends it, so the L1 TTL bounds staleness only when the eviction reached Redis; and cache keys do not include the tenant, so with multi-tenancy the key has to carry it
  • With ddk.web.cors.allow-credentials=true, startup now also fails for origin patterns whose host is only wildcards, such as https://*, *://* or https://*:8080. Only the literal * was rejected before, although the origins are applied as patterns, so these let any site call the API with the user's credentials. Patterns that fix the domain, such as https://*.example.com, still work
  • The error contract in the API docs includes 429 with RATE_LIMITED, which @RateLimit answers with
  • The cache's level 2 no longer falls back to JDK serialization when the Redis starter's allow-listed serializer is missing, for example because the application excluded the Redis starter's auto-configuration. It used to, silently: anyone who could write to Redis could then make the application instantiate any class, and the values were binary instead of JSON. It now builds the same allow-listed JSON serializer, trusting the application's packages, and logs a warning
  • The Javadoc of DomainEventPublisher and the event starter's README said that every subscriber must use @TransactionalEventListener(AFTER_COMMIT). Since the outbox, events are published after the write and before the commit, and the generated AGENTS.md already told the other half: work that must commit with the business, such as translating to an integration event, uses @EventListener. Both now give the two cases
  • The concurrency starter's README states that the keys of @Idempotent, @RateLimit and @AggregateLock do not include the tenant, and shows how to add it