Skip to content

Commit 19de2ef

Browse files
committed
Process review comments
- Adjust heartbeat configuration example to show how to disable it, as enabled is the default. - Replace sort for filter in the handler-enhancers.md section, as that's more to the point - Drop "command handling components" notice from the given phase description, as it's the aggregate under test. Emphasize the registerAnnotatedCommandHandler option with a link to external command handlers as a replacement. #304
1 parent 0565ad2 commit 19de2ef

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

appendices/message-handler-tuning/handler-enhancers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can use handler enhancers to intercept and perform checks on groups of `@Mes
99
To create a handler enhancer, you implement the `HandlerEnhancerDefinition` interface and override the `wrapHandler()` method.
1010
All this method does is give you access to the `MessageHandlingMember<T>`, which is an object representing any handler specified in the system.
1111

12-
You can then sort these handlers based on the type of `Message` they handle by using the `MessageHandlingMember.canHandleMessageType(Class<? extends Message>)` method.
12+
You can then filter these handlers based on the type of `Message` they handle by using the `MessageHandlingMember.canHandleMessageType(Class<? extends Message>)` method.
1313
Doing so, you can specifically enhance message handlers dealing with, for example, the `CommandMessage`.
1414

1515
For your handler enhancer to run, you'll need to create a `META-INF/services/org.axonframework.messaging.annotation.HandlerEnhancerDefinition` file containing the fully qualified class name of the handler enhancer you have created or register the enhancer explicitly in the `Configurer`.
@@ -67,7 +67,7 @@ public @interface MyAnnotation {
6767

6868
1. Implement the `HandlerEnhancerDefinition` interface
6969
2. Override the `wrapHandler` method to perform your logic.
70-
3. Sort out the types of handlers you want to wrap based on a specific attribute, for example, the `metaDataKey` attribute from the `MyAnnotation`.
70+
3. Filter the types of handlers you want to wrap based on a specific attribute, for example, the `metaDataKey` attribute from the `MyAnnotation`.
7171
4. Handle the method inside of a `MessageHandlingMember`. In this case, indicating the handler is only suitable if the meta-data key matches a value.
7272
5. For annotation-specific attributes to exist in the `MessageHandlingMember's` attribute collection, meta-annotation the custom annotation with `HasHandlerAttributes`.
7373
6. If you are not interested in wrapping the handler, return the original passed into the `wrapHandler` method.

axon-framework/testing/commands-events.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ public class GiftCardTest {
8383
>}
8484
>```
8585
86-
87-
88-
89-
9086
The "given-when-then" test fixture defines three stages: configuration, execution and validation. Each of these stages is represented by a different interface: `FixtureConfiguration`, `TestExecutor` and `ResultValidator`, respectively.
9187
9288
> **Fluent Interface**
@@ -111,7 +107,7 @@ During the configuration phase \(i.e. before the first "given" is provided\), yo
111107
112108
* `registerAnnotatedCommandHandler`:
113109
114-
Registers a Annotated Command Handler object.
110+
Registers a [Annotated Command Handler object](../axon-framework-commands/command-handlers.md#external-command-handlers) that interacts with the aggregate.
115111
Use this method to register components containing `@CommandHandler` annotated methods that invoke the `Repository` to execute operation on an aggregate.
116112
You may end up in such a scenario when you prefer that command handlers and/or command messages are not contained inside the domain model (i.e. the aggregate).
117113
@@ -170,7 +166,7 @@ During the configuration phase \(i.e. before the first "given" is provided\), yo
170166
### Given Phase
171167
172168
Once you have configured the fixture, you can start the given phase.
173-
Axon's test fixtures provide several given methods aligning with the modeling option of the aggregate.
169+
Axon's test fixtures provide several given methods aligning with the modeling options of an aggregate.
174170
Below is a list of all the operations of the given phase:
175171
176172
* `givenNoPriorActivity`:
@@ -219,7 +215,7 @@ We can separate the execution phase options into roughly three variants:
219215
Below is a list of all the operations you can use in the execution phase:
220216
221217
* `when(Object)`:
222-
Using the `when` method, you can provide a command for the fixture to execute against the command handling component under test.
218+
Using the `when` method, you can provide a command for the fixture to execute against the aggregate under test.
223219
Similar to the given events, if the provided command is of type `CommandMessage`, the fixture dispatches it as is.
224220
The fixture monitors the behavior of the invoked handler \(either on the aggregate or as an external handler\) and compares it to the expectations you register in the [validation phase](#validation-phase).
225221
* `when(Object, Map<String, ?>)`:
@@ -242,7 +238,8 @@ Below is a list of all the operations you can use in the execution phase:
242238
243239
### Validation Phase
244240
245-
The last phase is the validation phase, which allows you to check on the activities of the command handling component. This is generally done purely in terms of return values and events.
241+
The last phase is the validation phase, which allows you to check on the activities of the aggregate.
242+
This is generally done purely in terms of return values and events.
246243
247244
#### Validating Command Result
248245

axon-server/administration/monitoring/heartbeat-monitoring.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ axoniq.axonserver.heartbeat.enabled=true
1717

1818
Please note that when combining Axon Server with Axon Framework, the framework application should also have Heartbeat Monitoring enabled.
1919
Note that this is enabled *by default* in Axon Framework.
20-
If you want to emphasize this further, regard the following configuration:
20+
21+
If you want to disable heartbeat monitoring this further, regard the following configuration:
2122

2223
{% tabs %}
2324
{% tab title="Axon Configuration API" %}
2425
```java
2526
public class AxonConfig {
2627
// ...
27-
public void enableHeartbeats(Configurer configurer) {
28+
public void disableHeartbeats(Configurer configurer) {
2829
configurer.registerComponent(AxonServerConfiguration.class, config -> {
2930
AxonServerConfiguration.HeartbeatConfiguration heartbeatConfig =
3031
new AxonServerConfiguration.HeartbeatConfiguration();
31-
heartbeatConfig.setEnabled(true);
32+
heartbeatConfig.setEnabled(false);
3233

3334
AxonServerConfiguration serverConfig = new AxonServerConfiguration();
3435
serverConfig.setHeartbeat(heartbeatConfig);
@@ -41,7 +42,7 @@ public class AxonConfig {
4142

4243
{% tab title="Spring Boot Auto Configuration" %}
4344
```text
44-
axon.axonserver.heartbeat.enabled=true
45+
axon.axonserver.heartbeat.enabled=false
4546
```
4647
{% endtab %}
4748
{% endtabs %}

0 commit comments

Comments
 (0)