Name your state store via Materialized.as('<store-name>') when defining an aggregation, KTable, or global KTable.
Enable interactive queries by configuring application.server to the host:port of the current instance.
In your application, obtain a ReadOnlyKeyValueStore or ReadOnlyWindowStore via streams.store(StoreQueryParameters.fromNameAndType(...)).
Query the store locally for keys resident on this instance; for keys on other instances, use the metadata API (streams.queryMetadataForKey) to discover which host owns the key and issue a remote HTTP call.
Expose a simple HTTP endpoint (e.g., using Javalin or Spring) that serves local store queries and proxies remote ones.
Monitor store restoration lag during startup using streams.metrics() before serving queries.
Known gotchas
Interactive queries are only available after the application transitions to RUNNING state; querying during REBALANCING returns errors or stale results.
State stores do not replicate synchronously to standbys; a failover leaves a window where the new primary is restoring from changelog and cannot serve queries.
Do not hold references to store handles across rebalances; always re-fetch the store handle after a state transition.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp