Parameter resolvers
A handler can ask for message context directly in its parameters. You do not need to look up the current message or pass its timestamp through your own helper methods.
Example: default resolution
Section titled “Example: default resolution”For example, add an Instant parameter to receive the event’s timestamp:
@HandleEventvoid handle(CreateUser event, Instant timestamp) { log.info("User created at {}", timestamp);}@HandleEventfun handle(event: CreateUser, timestamp: Instant) { log.info("User created at {}", timestamp)}How it works
Section titled “How it works”Fluxzero resolves handler arguments by their type and annotations. You normally only declare the parameters you need.
By default, Fluxzero supports injection of the following parameters into handler methods:
- The message payload (automatically matched by type)
- The full
Message,Schedule, orWebRequest - The raw
DeserializingMessageorSerializedMessage(for low-level access) - The message
Metadata - The message timestamp as
InstantorClock - The currently authenticated
User(if available) - The associated
Entitywrapper or the entity value itself - The triggering message (annotated with
@Trigger) - Any Spring bean (when Spring integration is enabled)
Other contextual values like message ID, timestamp, etc. can be obtained from the Message.
Writing your own parameter resolver
Section titled “Writing your own parameter resolver”Add a resolver when your application has a context type that the SDK does not know. Here RequestOrigin groups
an optional source metadata value; it is descriptive context, not a trusted authentication identity.
public record RequestOrigin(String source) {}
public class RequestOriginResolver implements ParameterResolver<DeserializingMessage> { @Override public Function<DeserializingMessage, Object> resolve(Parameter parameter, Annotation methodAnnotation) { if (parameter.getType().equals(RequestOrigin.class)) { return message -> new RequestOrigin(message.getMetadata().get("source")); } return null; }}data class RequestOrigin(val source: String?)
class RequestOriginResolver : ParameterResolver<DeserializingMessage> { override fun resolve(parameter: Parameter, methodAnnotation: Annotation): Function<DeserializingMessage, Any>? { return if (parameter.type == RequestOrigin::class.java) { Function { msg -> RequestOrigin(msg.metadata.get("source")) } } else null }}Register it on your application’s FluxzeroBuilder builder before building the client:
builder.addParameterResolver(new RequestOriginResolver());builder.addParameterResolver(RequestOriginResolver())Then request that type in a handler:
@HandleCommandvoid handle(CreateOrder command, RequestOrigin origin) { log.info("Order requested from {}", origin.source());}@HandleCommandfun handle(command: CreateOrder, origin: RequestOrigin) { log.info("Order requested from {}", origin.source)}Return null from resolve for parameters your resolver does not recognize, so other resolvers can handle them.
Use cases
Section titled “Use cases”- Injecting request-specific context (e.g. tracing info)
- Supporting custom annotations (e.g.
@FromHeader) - Enabling access to correlated data (e.g. parent entity)
- Binding to environment or system values
See ParameterResolver for the resolver contract and matching options.
© 2026 Fluxzero