1.7.0
This release brings numerous API improvements, as well as fixes and infrastructure updates to the framework.
Breaking Changes
-
The
BlackBoxContext
-based tests now fail if a runtime exception was thrown within the signal handlers.In order to address #1314, we've decided to enforce the fail-fast approach within the BBC tests done in #1322. From now on, if a test case had any runtime exceptions thrown from signal handlers the test is failed by the BBC. While it may be a breaking change for some, we believe it worth fixing such issues right away than hiding them under the carpet.
If one requires to fall back to the previous behavior, the BBC instance can be configured using the newly introduced
tolerateFailures
method. -
The
grand_origin
field is no longer set to a default instance for the signalOrigin
if no grand origin is present (see #1341 for details). -
The
ServerEnvironment
API is improved and changed as a result of the #1315 and related discussions in a series of PRs (#1327, #1331, #1336).The previously deprecated
configure...()
API is removed in favor of the new fluentwhen().use()
API.So now, instead of smth like this:
ServerEnvironment.use(productionStorageFactory, Production.class) .use(testingStorageFactory, Tests.class) .use(memoizingTracerFactory, Production.class)
One should use the following snippet:
ServerEnvironment.when(Production.class) .use(productionStorageFactory) .use(memoizingTracerFactory); ServerEnvironment.when(Tests.class) .use(testingStorageFactory);
API Changes
-
Change
type validation requirements are relaxed for primitive type changes.The
new_value
field is no longer a required one forStringChange
andBytesChange
types. See #1307 for details. -
Introduced simplified
unicast()
methods in theEventRouting
.The new
unicast()
API allows simplifying and prettifying the even routing for the cases where a singular ID is used.Now, instead of smth like this:
@OverridingMethodsMustInvokeSuper @Override protected void setupEventRouting(EventRouting<AirportId> routing) { super.setupEventRouting(routing); routing.route(FlightScheduled.class, (e, ctx)-> EventRoute.withId(e.getAirport())); }
One can use the following API:
@OverridingMethodsMustInvokeSuper @Override protected void setupEventRouting(EventRouting<AirportId> routing) { super.setupEventRouting(routing); routing.unicast(FlightScheduled.class, FlightScheduled::getAirport) }
To find out more details on the new API please check #1317.
-
Added
localDate
andlocalDateTime
helpers to theWithTime
interface.This feature allows accessing
localDate
andlocalDateTime
methods from within all the signals. From now on, if one requires a JavaLocalDate
orLocalDateTime
instances over the ProtobufTimestamp
or JavaInstant
that were previously available for signals, they may use the new API to simplify such a conversion and access to the signalstimestamp
field.See #1319 for additional details.
Fixes
-
Improved multitenant delivery support by ensuring the tenant is properly propagated within the delivery (see #1308).
-
Fixed a typo in the
io.spine.client.Client
shutdownTimeout
method (see #1339). -
Fixed dispatching of rejections caused by a particular command (see #1318 and #1343).
Infrastructure
- The libraries now do not use
implementation
for compile-only annotations likeerrorprone
annotations but use the newly introducedcompileOnlyApi
configuration for such dependencies (see #1340).
Compare v1.6.0 and v1.7.0.