Processes place order commands and persists resulting events.
// Source: https://github.com/eugene-khyst/postgresql-event-sourcing | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package com.example.eventsourcing.service.command;
import com.example.eventsourcing.domain.command.PlaceOrderCommand;
import eventsourcing.postgresql.domain.Aggregate;
import eventsourcing.postgresql.domain.command.Command;
import eventsourcing.postgresql.service.command.CommandHandler;
import jakarta.annotation.Nonnull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class PlaceOrderCommandHandler implements CommandHandler<PlaceOrderCommand> {
@Override
public void handle(Aggregate aggregate, Co
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key