Processing and coordinating streams
Stateful stream processing, windows and joins, and sagas that coordinate work across services.
Enrich
A shipment event names a carrier and nothing about it, and the customer needs the mode and the tracking link. A Camel Content Enricher asks the owner for every record; a Kafka Streams join reads a local copy of the owner's topic. They differ when the reference changes and when the owner is down.
Join
shipping-service books a carrier only when stock is reserved and payment is taken, two facts on two topics that arrive in either order. A windowed join pairs them by event time; a Camel aggregator pairs them by arrival, and the two disagree.
Aggregate
A carrier collects parcels in pickup slots, and the warehouse needs one list per carrier per slot. Kafka Streams closes a window of event time and emits one final list; the Camel Aggregator closes a batch by size or quiet time in arrival order.
Saga
An order touches three databases and no transaction spans them. A saga is a chain of local transactions, each publishing the event that starts the next, and a failure is undone by new events. Order, stock and payment are choreographed with no coordinator, and the saga handles a declined payment, a service that does not answer and a late reply.
Orchestrated sagas: Camel Saga and Quarkus Flow
An orchestrator holds the sequence of an order saga in one place. The Camel Saga EIP hands the saga to an LRA coordinator that calls each participant's registered compensation; a Quarkus Flow workflow keeps the sequence and its state itself and compensates with tasks.
Decisions on events
A carrier reports an undelivered parcel in a sentence its driver typed, and shipping-service must ship again or refund. A local model turns the sentence into one reason from a closed set; a Drools rule unit decides from the recorded reason; a replay decides again from the record with no model call.