Skip to content

Commit

Permalink
walkthrough documentation - minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
JohT committed Dec 27, 2021
1 parent c043f97 commit 343d177
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions showcase-quarkus-eventsourcing/WALKTHROUGH.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ and returns all beans (of any type) that CDI discovers (in respect of its config

### Application startup

Axon configuration is created the first time it is used. The disadvantage of this is, that the application might benefit from a warm up. The advantage is, that this works for all CDI containers including Quarkus in native mode. Even if `@Observes @Initialized(ApplicationScope.class)` is Standard CDI and could be used to call a method on server start, Quarkus would run this e.g. in native mode during build. For details see [Quarkus Application Initialization and Termination][QuarkusLivecycle].
Axon configuration is created the first time it is used. The disadvantage of this is, that the application might benefit from a warm up. The advantage is, that this works for all CDI containers including Quarkus in native mode. Even if `@Observes @Initialized(ApplicationScope.class)` is standardized in CDI and could be used to call a method on server start, Quarkus would run this e.g. in native mode during build. For details see [Quarkus Application Initialization and Termination][QuarkusLivecycle].

## Connecting JTA Transactions to AxonFramework

Expand All @@ -66,10 +66,10 @@ This is pretty similar to [AxonFramework/cdi JtaTransactionManager.java](https:/

## Connecting JSON Binding to AxonFramework

[JsonbSerializer.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/JsonbSerializer.java) implements [JSON Binding][JSONBinding] as `Serializer` for AxonFramework. As an alternative, Jackson could be used as well. [JSON Binding][JSONBinding] had be chosen here to be fully compliant to the MicroProfile Standard.
[JsonbSerializer.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/JsonbSerializer.java) implements [JSON Binding][JSONBinding] as `Serializer` for AxonFramework. As an alternative Jackson could be used as well. [JSON Binding][JSONBinding] had been chosen here to stay within the libraries that are included in [MicroProfile][MicroProfile].

AxonFramework has build-in support for Jackson JSON serializer. Some of its internal serializable data types need to be adapted to be used with [JSON Binding][JSONBinding].
These are internally registered in [JsonbAxonAdapterRegister.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbAxonAdapterRegister.java). Except for the generic [JsonbMetaDataAdapter.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbMetaDataAdapter.java) and [JsonbReplayTokenAdapter.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbReplayTokenAdapter.java) the remaining ones shouldn't be needed any more since [AxonFramework PullRequest #1163](https://github.com/AxonFramework/AxonFramework/pull/1163).
AxonFramework has build-in support for Jackson JSON serializer. For [JSON Binding][JSONBinding], some of Axon's internal serializable data types need to be adapted.
These are registered in [JsonbAxonAdapterRegister.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbAxonAdapterRegister.java). Except for [JsonbMetaDataAdapter.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbMetaDataAdapter.java) and [JsonbReplayTokenAdapter.java](./src/main/java/io/github/joht/showcase/quarkuseventsourcing/messaging/infrastructure/axon/serializer/jsonb/axon/adapter/JsonbReplayTokenAdapter.java) the remaining ones shouldn't be needed any more since [PullRequest #1163](https://github.com/AxonFramework/AxonFramework/pull/1163).

## Mitigate Core API dependencies

Expand Down Expand Up @@ -102,7 +102,7 @@ AnnotationCommandTargetResolver.builder()

Plain old java objects (POJO) are widely supported by almost any serialization (JSON, XML,..) library.
When Domain Driven Design is applied, value objects should be immutable.
Their properties should only be set once during creation and should then remain unchangeable.
Their properties should only be set once during creation and should then remain unchanged.
This is usually done by using constructor parameters. To simplify creating complex objects, builders can be provided as well.

When it comes to immutable value objects using constructor parameters, serialization libraries need to know which field should be mapped to which constructor argument. If there are a couple of constructors, it gets even more complicated.
Expand Down

0 comments on commit 343d177

Please sign in to comment.