Skip to content

1.6.0

Compare
Choose a tag to compare
@dmitrykuzmin dmitrykuzmin released this 09 Sep 17:35
· 2578 commits to master since this release
995bdcf

This release brings numerous API improvements, as well as fixes and infrastructure updates to the framework.

API changes

Client

  1. The ability to postAndForget() a command is added to the Client. 
This method should be called when the user does not care about events/rejections produced by a command.
    The previously used post() method is reserved for cases when one or more event types are actually observed by the client. The value returned by post() can no longer be ignored [#1292].
  2. 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 any BoundedContext [#1258].
  3. The Client is extended with methods to handle streaming and server errors when executing requests [#1270].

Server

  1. The custom environments support is introduced [#1274, #1293].
    
The Environment 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 of base.
    The ServerEnvironment 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.

  1. Breaking change: Most of the @Internal methods of BoundedContext moved to its internal class InternalAccess instance of which is available via the internalAccess() method.
    The method is available only to the server-side framework code.
  2. Delivery API is extended with a factory method which allows to create asynchronous version of local Delivery [#1265].
  3. The Pair can now be created from an already existing Optional [#1296].
  4. The proper support to the CommandBus filters which throw rejections is added [#1295].

Model

  1. 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].
  2. (set_once) constraint in entity states is no longer ignored [#1268].
  3. @ByField is deprecated in favour of @Where [#1270].

Logging

  1. The DiagnosticLog messages are made more detailed [#1262].
  2. 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:

  1. BlackBoxBoundedContext is renamed to BlackBoxContext.
  2. Outdated Verify-based API is removed.
  3. BlackBoxContext no longer exposes eventBus() and commandBus().
  4. The BlackBoxContext.subscribeTo(Topic) semantics changed. See #1249.
  5. Simplified combinations of UserId and ZoneId parameters of BlackBoxContext.

Fixes

The Migration logic is fixed to properly support entity state updates [#1298].

Infrastructure

The project build scripts are migrated to Kotlin [#1278].