1.6.0
This release brings numerous API improvements, as well as fixes and infrastructure updates to the framework.
API changes
Client
- The ability to
postAndForget()
a command is added to theClient
. This method should be called when the user does not care about events/rejections produced by a command.
The previously usedpost()
method is reserved for cases when one or more event types are actually observed by the client. The value returned bypost()
can no longer be ignored [#1292]. - Event subscriptions are now more flexible, allowing to subscribe to events produced by non-entity objects (e.g.
AbstractEventReactor
) as well as events not explicitly declared in anyBoundedContext
[#1258]. - The
Client
is extended with methods to handle streaming and server errors when executing requests [#1270].
Server
- The custom environments support is introduced [#1274, #1293].
TheEnvironment
now exposes API to register user-defined environment types and to determine which one is enabled at any given moment of time. See the release notes ofbase
.
TheServerEnvironment
allows to configure environment-dependent values, as follows:
StorageFactory factory = InMemoryStorageFactory.newInstance();
ServerEnvironment.instance()
.use(factory, Tests.class);
The Spine framework provides two environments out of the box: Production
and Tests
.
- Breaking change: Most of the
@Internal
methods ofBoundedContext
moved to its internal classInternalAccess
instance of which is available via theinternalAccess()
method.
The method is available only to the server-side framework code. - Delivery API is extended with a factory method which allows to create asynchronous version of local
Delivery
[#1265]. - The
Pair
can now be created from an already existingOptional
[#1296]. - The proper support to the
CommandBus
filters which throw rejections is added [#1295].
Model
- The
@External
annotation is introduced to mark the handler method parameters of an external origin. It replaces the previously used for this purpose(external = true)
attribute of@Subscribe
,@React
, and@Command
annotation. The attribute is deprecated [#1269]. (set_once)
constraint in entity states is no longer ignored [#1268].@ByField
is deprecated in favour of@Where
[#1270].
Logging
- The
DiagnosticLog
messages are made more detailed [#1262]. - The standard framework exceptions are expanded with more info [#1255].
Testing
Various quality-of-life changes are introduced for the testing API.
See #1249, #1251, #1252, and #1261 for details.
Some of the testing API changes are breaking. They include:
BlackBoxBoundedContext
is renamed toBlackBoxContext
.- Outdated
Verify
-based API is removed. BlackBoxContext
no longer exposeseventBus()
andcommandBus()
.- The
BlackBoxContext.subscribeTo(Topic)
semantics changed. See #1249. - Simplified combinations of
UserId
andZoneId
parameters ofBlackBoxContext
.
Fixes
The Migration
logic is fixed to properly support entity state updates [#1298].
Infrastructure
The project build scripts are migrated to Kotlin [#1278].