Roots: key and value
In most expressions two root identifiers are in scope:
key— the record keyvalue— the record value
#,
the standard SpEL convention):
The editor highlights the identifiers that are valid in the field you’re
editing, and the validator rejects out-of-scope ones with a hint (e.g.
Unknown root identifier: aggValue. Use key, value or #aggValue.).
Types drive the editor
What you can do withkey and value depends on their configured types
(the stream’s default serdes, per-node overrides, or the editor’s type hints):
- JSON / JSON Schema / Avro / Protobuf — map-style access:
value['field'],value.containsKey('field'). String methods are not available on the record itself. - String — string methods:
value.length(),value.contains('x'),value.toLowerCase(). No map-style access. - Numbers (Integer, Long, Float, Double, Short) — numeric methods and arithmetic.
- Bytes — raw byte access.
value.someCall(). the editor infers the intermediate type and suggests only
what fits.
The editor box is resizable — drag its corner to make room for longer
expressions.
Producing multiple values
flatMap / flatMapValues emit several records from one input. Return an
inline list literal:
Calling Java
Static calls on a small allowlist of safe types are available viaT(...):
Math, the numeric box types, String, Map/List, UUID, and Kafka’s
Bytes.
Custom functions
Operators can extend the vocabulary without recompiling Alginte: register public static Java methods (from a JAR on the classpath) underkafka.streams.transformation.functions, and call them as #name(args) in
any expression — with full editor support.