Commit Graph

17 Commits

Author SHA1 Message Date
Gerard Klijs 3af60557bd BAEL-5856 Using and testing Axon applications via REST (#13134)
Co-authored-by: Ashley Frieze <ashley@incredible.org.uk>
2023-01-23 22:24:35 +00:00
Gerard Klijs d54d4768c0 BAEL-5855 Persisting the Query Model (#12976)
* BAEL-5855 Persisting the Query Model

* BAEL-5855 Persisting the Query Model, apply baeldung code style.
2022-11-27 17:00:47 +00:00
Gerard Klijs 8c8bb9a0e1 BAEL-5807 Add streaming query (#12769) 2022-10-02 09:47:55 +05:30
Gerard Klijs 2f9967dcd3 BAEL-4769 Additions for 'Querying the Query Model in Axon' (#12578)
* Update to latest and include script to start axon server

* Add the two other types of queries

* Add unit and integration tests for the queries

* BAEL-4769 Formatting

Co-authored-by: bipster <openbip@gmail.com>
2022-09-06 14:04:07 -04:00
Steven van Beelen c1fe739e37 [BAEL-4768] Snapshotting the Aggregate in Axon (#11103)
* Add configuration class

Add configuration class

#BAEL-4768

* Add SnapshotTriggerDefinition bean creation method

Add SnapshotTriggerDefinition bean creation method

#BAEL-4768

* Add SnapshotTriggerDefinition bean name

Add SnapshotTriggerDefinition bean name

#BAEL-4768

* Add threshold behind property value

Add threshold behind property value. Default to 250.

#BAEL-4768

* Add link to the readme

Add a link to the article in the readme

#BAEL-4768

* Process review comments

- Drop readme line
- Adjust parameter indentation of config class

#BAEL-4768
2021-09-25 18:43:54 +05:30
Steven van Beelen af4e82b089 Update previous complete test endpoints
The test endpoints used to create an order, add a product, confirm the
order and ship it are not embracing the asynchronous approach of the
CommandGateway. Make sure that all commands are composed with one
another and return the completable future for Spring to resolve

#BAEL-4767
2021-03-19 11:54:20 +01:00
Steven van Beelen 2b351eda7a Rename API in line with adjusted approach
Change PlaceOrderCommand/OrderPlacedEvent to
CreateOrderCommand/OrderCreatedEvent. Placed suggests it is already
placed, meaning products cannot be changed. However with the new
OrderLine member and its operations it's no longer correct to state the
order placed upon creation. Furthermore, the OrderedProduct is no longer
 a single product, but contains several. Renaming this to Order is more
 in line with what this query model resembles

#BAEL-4767
2021-03-19 11:35:31 +01:00
Steven van Beelen 70189df008 Update http file for testing
Add additional operations to the order-api.http file to simplify testing

#BAEL-4767
2021-03-19 11:24:08 +01:00
Steven van Beelen 68276b8041 Allow all operations on the Controller
Add post mappings to allow single creation of an Order, influencing all
aspects of an Order

#BAEL-4767
2021-03-19 11:23:46 +01:00
Steven van Beelen b578c885e4 Add aggregate test cases
Add test cases to reach a 100% coverage of all message handling
functions of the OrderAggregate and OrderLine member. Added, upgrade to
JUnit 5

#BAEL-4767
2021-03-19 11:09:48 +01:00
Steven van Beelen 41d47f8aa6 Update Projection
Add event handlers to update the products map of the OrderedProduct
model

#BAEL-4767
2021-03-19 11:08:42 +01:00
Steven van Beelen 886368a4c3 Update Command Model
Adjust the OrderAggregate to contain an OrderLine aggregate member. The
OrderLine is added as soon as a Product is added through the
AddProductCommand. The OrderLine member is capable of handling the
increment and decrement product count commands, to increase/decrease the
 number of instances for that OrderLine. Decreasing the count below 1
 will publish the ProductRemovedEvent from within the OrderLine.
 Additional business validation is added to unsure a given Product isn't
  added twice (adding a second should go through increment) and that the
   products aren't adjusted as soon as the product is confirmed.

#BAEL-4767
2021-03-19 11:07:26 +01:00
Steven van Beelen ef1167b037 Update Exception API
- Introduce a DuplicateOrderLineException to signal whenever somebody
wants to add the same product twice instead of using the increment
command.
- Introduce OrderAlreadyConfirmedException to signal whenever the order
is confirmed, so that adding products and incrementing/decrementing
their count is not possible once the order has been confirmed

#BAEL-4767
2021-03-19 11:04:12 +01:00
Steven van Beelen 2b2aff5ceb Update Query API
Change the OrderedProduct model such that it contains a map of products
having the count as its value, instead of a single product.

#BAEL-4767
2021-03-19 11:01:19 +01:00
Steven van Beelen a9812052df Update Event API
- Adjust OrderPlacedEvent to only construct the order
- Introduce ProductAddedEvent to be able to add several products
to a order
- Introduce ProductCountIncrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductCountDecrementedEvent to increase the number of
product instances for a given Order
- Introduce ProductRemovedEvent to signal whenever all the product count
 drops below 1

#BAEL-4767
2021-03-19 10:59:26 +01:00
Steven van Beelen 10c0f2302e Update Command API
- Adjust PlaceOrderCommand to only construct the order
- Introduce AddProductCommand to be able to add several products to an
order
- Introduce IncrementProductCountCommand to increase the number of
product instances for a given Order
- Introduce DecrementProductCountCommand to increase the number of
product instances for a given Order

#BAEL-4767
2021-03-19 10:57:51 +01:00
Eric Martin 3225470df5 Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2
Revert "BAEL-3275: Using blocking queue for pub-sub"
2019-10-31 20:43:47 -05:00