You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2018. It is now read-only.
- Replace issue tracker reference for github/axonframework/issues
reference
- Add a note to point out it's by design that you cannot associate
domain concepts with Objects as the identifier
- Add additional constructor parameters for SpringCloudCommandRouter
- Add a note that it's required to enabled heartbeat events within your
spring application when using the SpringCloudCommandRouter
- Add a section to describe how to order Event Handlers within an Event
Processor
Copy file name to clipboardExpand all lines: part1/introduction.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ When you're stuck
90
90
91
91
While implementing your application, you might run into problems, wonder about why certain things are the way they are, or have some questions that need an answer. The Axon Users mailing list is there to help. Just send an email to [[email protected]](mailto:[email protected]). Other users as well as contributors to the Axon Framework are there to help with your issues.
92
92
93
-
If you find a bug, you can report them at [issues.axonframework.org](http://issues.axonframework.org). When reporting an issue, please make sure you clearly describe the problem. Explain what you did, what the result was and what you expected to happen instead. If possible, please provide a very simple Unit Test (JUnit) that shows the problem. That makes fixing it a lot simpler.
93
+
If you find a bug, you can report them at [github.com/AxonFramework/issues](https://github.com/AxonFramework/AxonFramework/issues). When reporting an issue, please make sure you clearly describe the problem. Explain what you did, what the result was and what you expected to happen instead. If possible, please provide a very simple Unit Test (JUnit) that shows the problem. That makes fixing it a lot simpler.
94
94
95
95
Contributing to Axon Framework
96
96
==============================
@@ -99,7 +99,7 @@ Development on the Axon Framework is never finished. There will always be more f
99
99
100
100
There are a number of ways in which you can contribute to the Axon Framework:
101
101
102
-
- You can report any bugs, feature requests or ideas for improvements on our issue page: [issues.axonframework.org](http://issues.axonframework.org). All ideas are welcome. Please be as exact as possible when reporting bugs. This will help us reproduce and thus solve the problem faster.
102
+
- You can report any bugs, feature requests or ideas for improvements on our issue page: [github.com/AxonFramework/issues](https://github.com/AxonFramework/AxonFramework/issues). All ideas are welcome. Please be as exact as possible when reporting bugs. This will help us reproduce and thus solve the problem faster.
103
103
104
104
- If you have created a component for your own application that you think might be useful to include in the framework, send us a patch or a zip containing the source code. We will evaluate it and try to fit it in the framework. Please make sure code is properly documented using javadoc. This helps us to understand what is going on.
See [Event Handling Configuration](../part3/spring-boot-autoconfig.md#event-handling-configuration) for details on registering event handlers using Spring AutoConfiguration.
81
+
See [Event Handling Configuration](../part3/spring-boot-autoconfig.md#event-handling-configuration) for details on registering event handlers using Spring AutoConfiguration.
Copy file name to clipboardExpand all lines: part2/sagas.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ When a Saga manages a transaction across multiple domain concepts, such as Order
47
47
48
48
Associating a Saga with a concept is done in several ways. First of all, when a Saga is newly created when invoking a `@StartSaga` annotated Event Handler, it is automatically associated with the property identified in the `@SagaEventHandler` method. Any other association can be created using the `SagaLifecycle.associateWith(String key, String/Number value)` method. Use the `SagaLifecycle.removeAssociationWith(String key, String/Number value)` method to remove a specific association.
49
49
50
+
> Note
51
+
>
52
+
> The API to associate domain concepts within a Saga intentionally only allows a `String` or a `Number` as the identifying value, since a `String` representation of the identifier is required for the association value entry which is stored. Using simple identifier values in the API with a straightforward `String` representation is by design, as a `String` column entry in the database makes the comparison between database engines simpler. It is thus intentionally that there is no `associateWith(String, Object)` for example, as the result of an `Object#toString()` call might provide unwieldy identifiers.
53
+
50
54
Imagine a Saga that has been created for a transaction around an Order. The Saga is automatically associated with the Order, as the method is annotated with `@StartSaga`. The Saga is responsible for creating an Invoice for that Order, and tell Shipping to create a Shipment for it. Once both the Shipment have arrived and the Invoice has been paid, the transaction is completed and the Saga is closed.
Copy file name to clipboardExpand all lines: part3/command-dispatching.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -310,16 +310,22 @@ The Spring Cloud Connector setup uses the service registration and discovery mec
310
310
Giving a description of every Spring Cloud implementation would push this reference guide to far. Hence we refer to their respective documentations for further information.
311
311
312
312
The Spring Cloud Connector setup is a combination of the `SpringCloudCommandRouter` and a `SpringHttpCommandBusConnector`, which respectively fill the place of the `CommandRouter` and the `CommandBusConnector` for the `DistributedCommandBus`.
313
-
313
+
314
314
> **Note**
315
315
>
316
-
> The Spring Cloud Connector specific components for the `DistributedCommandBus` can be found in the `axon-distributed-commandbus-springcloud` module.
316
+
> When using the `SpringCloudCommandRouter`, make sure that your Spring application is has heartbeat events enabled. The implementation leverages the heartbeat events published by a Spring Cloud application to check whether its knowledge of all the others nodes is up to date. Hence if heartbeat events are disabled the majority of the Axon applications within your cluster will not be aware of the entire set up, thus posing issues for correct command routing.
317
317
318
318
The `SpringCloudCommandRouter` has to be created by providing the following:
319
319
320
320
- A "discovery client" of type `DiscoveryClient`. This can be provided by annotating your Spring Boot application with `@EnableDiscoveryClient`, which will look for a Spring Cloud implementation on your classpath.
321
321
322
-
- A "routing strategy" of type `RoutingStrategy`. The `axon-core` module currently provides several implementations, but a function call can suffice as well. If you want to route the Commands based on the 'aggregate identifier' for example, you would use the `AnnotationRoutingStrategy` and annotate the field on the payload that identifies the aggregate with `@TargetAggregateIdentifier`.
322
+
- A "routing strategy" of type `RoutingStrategy`. The `axon-core` module currently provides several implementations, but a function call can suffice as well. If you want to route the Commands based on the 'aggregate identifier' for example, you would use the `AnnotationRoutingStrategy` and annotate the field on the payload that identifies the aggregate with `@TargetAggregateIdentifier`.
323
+
324
+
Other optional parameters for the `SpringCloudCommandRouter` are:
325
+
326
+
- A "service instance filter" of type `Predicate<ServiceInstance>`. This predicate is used to filter out `ServiceInstances` which the `DiscoveryClient` might encounter which by forehand you know will not handle any command messages. This might be useful if you've got several services within the Spring Cloud Discovery Service set up which you do not want to take into account for command handling, ever.
327
+
328
+
- A "consistent hash change listener" of type `ConsistentHashChangeListener`. Adding a consistent hash change listener provides you the opportunity to perform a specific task if new members have been added to the known command handlers set.
323
329
324
330
The `SpringHttpCommandBusConnector` requires three parameters for creation:
325
331
@@ -329,6 +335,10 @@ The `SpringHttpCommandBusConnector` requires three parameters for creation:
329
335
330
336
- Lastly a "serializer" of type `Serializer`. The serializer is used to serialize the command messages before they are sent over the wire.
331
337
338
+
> **Note**
339
+
>
340
+
> The Spring Cloud Connector specific components for the `DistributedCommandBus` can be found in the `axon-distributed-commandbus-springcloud` module.
341
+
332
342
The `SpringCloudCommandRouter` and `SpringHttpCommandBusConnector` should then both be used for creating the `DistributedCommandsBus`. In Spring Java config, that would look as follows:
Copy file name to clipboardExpand all lines: part3/event-processing.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,14 @@ will trigger the creation of two Processors:
44
44
45
45
The Configuration API allows you to configure other strategies for assigning classes to processors, or even assign specific instances to specific processors.
46
46
47
+
### Ordering Event Handlers within a single Event Processor
48
+
49
+
To order Event Handlers within an Event Processor, the ordering in which Event Handlers are registered (as described in the [Registering Event Handlers](../part2/event-handling.md#registering-event-handlers) section) is guiding. Thus, the ordering in which Event Handlers will be called by an Event Processor for Event Handling is their insertion ordering in the configuration API.
50
+
51
+
If Spring is selected as the mechanism to wire everything, the ordering of the Event Handlers can be specified by adding the `@Order` annotation. This annotation should be placed on class level of your Event Handler class, adding a `integer` value to specify the ordering.
52
+
53
+
Do note that it is not possible to order Event Handlers which are not a part of the same Event Processor.
54
+
47
55
### Configuring processors
48
56
49
57
Processors take care of the technical aspects of handling an event, regardless of the business logic triggered by each event. However, the way "regular" (singleton, stateless) event handlers are Configured is slightly different from Sagas, as different aspects are important for both types of handlers.
0 commit comments