Class EventTransformerChain.Builder
java.lang.Object
io.axoniq.framework.messaging.transformation.events.EventTransformerChain.Builder
- Enclosing class:
EventTransformerChain
Fluent builder for
EventTransformerChain. An exact from match takes precedence over a
predicate match independent of registration order. Predicates are consulted only when no exact match
applies, in registration order.
build() produces a new, immutable EventTransformerChain; configuration is
startup-only, so register(EventTransformation) and maxIterationsPerEvent(int)
calls after build() are rejected.
maxIterationsPerEvent(int) caps how many times the chain re-applies transformations to a
single event during fixed-point chaining (default
EventTransformerChain.DEFAULT_MAX_ITERATIONS_PER_EVENT); it guards against a self-matching
or cyclic configuration and otherwise never fires.
Not thread-safe: build the chain on a single thread at startup, then share the
resulting EventTransformerChain (which is immutable and concurrent-safe).
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the immutable chain.maxIterationsPerEvent(int max) Sets the per-event iteration safety bound.register(EventTransformation transformation) Register anEventTransformationwith the chain.
-
Method Details
-
maxIterationsPerEvent
Sets the per-event iteration safety bound. Defaults toEventTransformerChain.DEFAULT_MAX_ITERATIONS_PER_EVENT.- Parameters:
max- the new safety bound, strictly positive- Returns:
- this builder
- Throws:
ChainConfigurationException- ifbuild()has already been calledAxonConfigurationException- ifmaxis not strictly positive
-
register
Register anEventTransformationwith the chain.A payload mapping with an exact
frommay change only the version, never theQualifiedName; such a name change is rejected here, at registration time. UseEventTransformation.rename(MessageType, MessageType)to change the name.- Parameters:
transformation- the transformation to add- Returns:
- this builder
- Throws:
ChainConfigurationException- ifbuild()has already been called, or iftransformationis a payload mapping whose exactfromandtoqualified names differ
-
build
Builds and returns the immutable chain.- Returns:
- the built chain
- Throws:
ChainConfigurationException- if two transformations match the same exact source identity
-