Simplified Event Externalization with Spring Modulith
Transactional service methods are a common pattern in Spring applications. These methods trigger a state transition important to the business. This usually involves a core domain abstraction, such as an aggregate and its corresponding repository. A stereotypical example of such an arrangement might look like this:
@Service
@RequiredArgsConstructor
class OrderManagement {
private final OrderRepository orders;
@Transactional
Order complete(Order order) {
return orders.save(order.complete());
}
}
As state transitions like these might be interesting to third parties, we might want…