Repository navigation
binding-mcp-schema-registry: add kind: proxy variant with operator-declared exit - #2231
Merged
Merged
Conversation
…tor-declared exit Adds a kind: proxy variant alongside the existing kind: client, letting the generated composite terminate at an operator-declared exit (a downstream binding in the same namespace) instead of baking in options.server. The exit travels through the generated mcp_openapi0 binding's own top-level exit (resolved to a fully-qualified qname up front) and mcp-openapi's composite generator now prefers a binding-level exit over the zilla.binding.mcp.openapi.http.client.exit configuration default when building mcp_http0's routes. Closes #2104.
mcp_openapi's own binding-level exit was schema-permitted even though kind: client never used it -- since McpOpenapiCompositeGenerator now prefers a binding-level exit over the httpClientExit configuration default (needed for mcp-schema-registry's new kind: proxy), an authored exit would have silently taken effect. Disallow it explicitly, matching how binding-mcp-schema-registry's own kind: client already disallows exit.
This was referenced Jul 31, 2026
3 tasks done
jfallows
pushed a commit
that referenced
this pull request
Aug 20, 2026
common-lang reaches binding-tcp only transitively through engine, which is a provided-scope dependency here; the notice-plugin's includeScopes is compile-only, so provided-scope transitives are correctly excluded (engine and its own dependencies are attributed via the Docker image assembly, not per-binding). The checked-in NOTICE incorrectly listed common-lang since #2231 -- unrelated to this branch's own change of adding common-lang as a real (compile-scope) dependency of engine. Verified against the authoritative NOTICE.expected produced by a full reactor build (mirroring CI's ./mvnw clean package): the only diff was this one stray line.
jfallows
added a commit
that referenced
this pull request
Aug 20, 2026
* feat(engine): encapsulate label management in the Router SPI Router/RouterContext gain supplyLabelId/supplyLabel (and Router gains watchLabels) so a Router implementation owns label-id assignment and lookup consistency, instead of the engine's own internal.LabelManager singleton. EngineRouter/TestRouter absorb LabelManager's in-memory behavior; the Engine remains solely responsible for bootstrapping from and flushing to the on-disk labels file, independent of which Router implementation is active, so zilla dump keeps working unchanged. * refactor(engine): make label bootstrap/id-assignment lock-free and file-agnostic EngineRouter/TestRouter drop all knowledge of the labels file and the synchronized block used to serialize new-label registration. Id assignment is now a plain ConcurrentHashMap + AtomicInteger (mirroring MemoryStoreHandler's lock-free style) since computeIfAbsent's per-key atomicity is the only guarantee actually needed. Engine now owns bootstrapping too: it reads the labels file itself and replays each entry through the ordinary supplyLabelId call before registering the watchLabels flush listener, so a Router implementation never needs file-reading logic to reproduce prior label ids. * refactor(engine): avoid autoboxing on Router.watchLabels notifications Router.watchLabels now takes ObjectIntBiConsumer<String> instead of BiConsumer<String, Integer>, mirroring the existing LongObjectBiConsumer pattern in this package. The primitive int overload lets EngineRouter/ TestRouter notify listeners on every new-label registration without boxing the label id. * refactor: consolidate ObjectIntBiConsumer into common-lang util.function binding-http and engine each carried their own copy of this helper functional interface. Helper functional interfaces of this shape already live in common-lang's util.function package (LongObjectBiFunction, LongObjectPredicate), so ObjectIntBiConsumer moves there too and both call sites reference the shared type instead of a local duplicate. engine now depends on common-lang (a dependency-free leaf module, no cycle risk) and re-exports it transitively so any Router implementation can reference ObjectIntBiConsumer; binding-http picks it up the same way it already does common-agrona, transitively through its existing engine dependency, with no pom.xml or module-info change needed there. * fix(binding-tcp): drop stray common-lang entry from NOTICE common-lang reaches binding-tcp only transitively through engine, which is a provided-scope dependency here; the notice-plugin's includeScopes is compile-only, so provided-scope transitives are correctly excluded (engine and its own dependencies are attributed via the Docker image assembly, not per-binding). The checked-in NOTICE incorrectly listed common-lang since #2231 -- unrelated to this branch's own change of adding common-lang as a real (compile-scope) dependency of engine. Verified against the authoritative NOTICE.expected produced by a full reactor build (mirroring CI's ./mvnw clean package): the only diff was this one stray line. --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
kind: proxyvariant tobinding-mcp-schema-registry, alongside the existingkind: client(#2068). Instead of baking a real HTTPoptions.serverinto the generated composite,kind: proxyexposes an operator-declaredexit(naming a downstream binding in the same namespace), letting the generated composite terminate there instead — e.g. a virtual schema-registry binding that implements Schema Registry semantics against Kafka rather than proxying to a real REST endpoint.The exit travels through the generated
mcp_openapi0binding's own top-levelexit:shorthand (resolved to a fully-qualified qname up front, via the sameresolveId/supplyQNamemechanism used for guarded refs and catalog references elsewhere in this generator).binding-mcp-openapi's composite generator now prefers a binding-levelexitover thezilla.binding.mcp.openapi.http.client.exitConfiguration default when buildingmcp_http0's routes, so the override is per-instance rather than JVM-wide.Changes
specs/binding-mcp-schema-registry.spec: schema patch allowskind: proxywith a requiredexit(disallowsoptions.server);kind: clientkeeps disallowingexit. New fixtures +SchemaTestcases for the valid/invalid combinations.config/binding-mcp-schema-registry.conf:McpSchemaRegistryOptionsConfigAdaptertreatsserveras optional (needed sincekind: proxyhas nooptions.server).runtime/binding-mcp-schema-registry:McpSchemaRegistryBinding/BindingContextwidened to acceptkind: proxy;McpSchemaRegistryBindingConfigresolves the binding's ownexitto a qname (filtering the synthetic exit-only route out of the declared-routes list, so "no declared routes" still means "expose all tools" underkind: proxy);McpSchemaRegistryCompositeGeneratorpasses the resolved exit through and omitsoptions.serverforkind: proxy.runtime/binding-mcp-openapi:McpOpenapiBindingConfigpicks up a binding-levelexit;McpOpenapiCompositeGeneratoruses it in preference to the configuredhttpClientExitdefault when stampingmcp_http0's routes.McpSchemaRegistryProxyITreuses the existing shared.rptscripts (the bundled OpenAPI spec's ownservers:entry already matches what those scripts expect, so no script changes were needed) against akind: proxyfixture with anexit:binding, in place of the client-kind IT'szilla.binding.mcp.openapi.http.client.exitsystem property override.Verified locally:
./mvnw verify(with local-o -Djacoco.skip=truefor iteration speed) is green forspecs/binding-mcp-schema-registry.spec,config/binding-mcp-schema-registry.conf,runtime/binding-mcp-openapi, andruntime/binding-mcp-schema-registry, including checkstyle, license checks, and all ITs (bothMcpSchemaRegistryProxyITand the existingMcpSchemaRegistryClientIT/McpOpenapiClientIT).Independent of and does not require touching the
kind: clientimplementation in #2068, per the issue.Fixes #2104
Generated by Claude Code