Posted on December 21, 2021
Spine 1.8.0
Base
This is a release of Spine base
modules, which supports the new features in the upcoming 1.8.0
release of Spine’s core-java
modules.
Core Java
This release brings numerous fixes, updates to API and performance improvements.
Breaking Changes
-
Instead of
NodeId
,ShardSessionRecord
now usesWorkerId
to indicate who is currently processing which shard.Thus, all shard processing sessions should be completed before the migration.
Please see #1433 for details.
API Changes
-
Made
BlackBoxContext
implementCloseable
(as addition of #1402). -
BlackBoxContext
API has been extended to provide an instance ofClient
linked to the context under the test.It makes possible to use
Client
in tests, for example:BlackBoxContext context = BlackBoxContext.from(...); ClientRequest clientRequest = context.client().asGuest(); assertThat(clientRequest.select(ProjectView.class).run()) .hasSize(0); clientRequest.command(createProject()).postAndForget(); assertThat(clientRequest.select(ProjectView.class).run()) .hasSize(1);
Please note, that provided
Client
would inheritTenantId
fromBlackBoxContext
, but would NOT inheritUserId
andZoneId
.Check #1407 for details.
-
Made API calls for the conditional settings of
ServerEnvironment
“lazy”.Previously, ServerEnvironment provided two kinds of API calls for the conditional settings:
ServerEnvironment.when(Staging.class) // This call is handy when `myStorageFactory` is already available. .use(myStorageFactory) ServerEnvironment.when(PreProduction.class) // And this one looks lazy, so that it is only executed when and _if_ requested. .use((env) -> createMySqlStorage())
However, in fact, there was no “lazy” behavior, which caused numerous workarounds to actually postpone the initialization of environment-specific settings until they start to make sense.
This release addresses the issue by making the behavior truly “lazy” (see #1421).
Fixes
-
Enabled
IntegrationBroker
dispatch events regardless of registration order of subscribing and publishing Bounded Contexts (see #1402). -
Transformation of an Entity’s state during
Migration
has been changed so that thenewState
completely overwrites the old one within the migration transaction (see #1405). -
The internals of
IntegrationBroker
were made more thread-safe (see #1423). -
SubscriptionService
now properly locates the Bounded Context when subscribing to events produced by standalone producers, such as descendants ofAbstractCommandHandler
orAbstractEventReactor
(see #1423).
Performance
- Improved Catch-up caching (see #1406 for details).
JDBC Storage
This is a public release of Spine libraries providing the Storage
implementations
for JDBC-compatible DB engines.
It supports all the features recently introduced
in the corresponding core-java:1.8.0
release.
Migration
Due to the changes introduces in core-java#1433,
the structure of shard_session_registry
table was changed. NODE_ID
field should be renamed
to WORKER_ID
. The field type remains the same.
It is also recommended to remove all shard_session_registry
entries before migration.
Fixes
- The reported
DbIterator
issue was resolved. Previously, in some corner cases, it was breaking the read operations for Aggregates. See #155 for more details.
Google Cloud Java
This is another public release of Spine libraries which streamline the development of apps running under GCP.
It supports all the features recently introduced
in the corresponding core-java:1.8.0
release.
Migration
In order to support the API change introduced in core-java#1433,
the datastore
library updates the storage schema. Instead of the ShardSessionRecord.node
field,
ShardSessionRecord.worker
field is now used.
ShardSessionRecord
s are short-lived by their nature, so the simplest migration strategy would be
to pause or stop the application instances, drop all remaining ShardSessionRecord
s and migrate
the traffic to the updated version of the application.
Special attention should be paid to the Datastore indexes, which previously could be created in
the applications built on top of Spine datastore
library. In case ShardSessionRecord.node
was included into any indexes, it might be a good idea to include ShardSessionRecord.worker
field instead.
Dart
This is a public release of Dart client library for Spine server-side apps.
It includes the custom Dart code generation for Protobuf types, and the client library itself.
The libraries are available via pub
:
The package is compatible with Spine servers in version 1.8.0
.
Web
This is a public release of Spine web
libraries, which support all the features
recently introduced
in the corresponding core-java:1.8.0
release.
Bootstrap
This public release brings the compatibility with the Spine release in version 1.8.0
.
Time
This is another public release of Spine time
library.
While it brings no particular features or fixes itself, this artifact serves to support the
general release of all Spine libraries in version 1.8.0
.