POC: Quarkus integration via shared transport Vert.x and Smithy Codegen extension#1205
Draft
chenliu0831 wants to merge 3 commits into
Draft
POC: Quarkus integration via shared transport Vert.x and Smithy Codegen extension#1205chenliu0831 wants to merge 3 commits into
chenliu0831 wants to merge 3 commits into
Conversation
chenliu0831
commented
May 22, 2026
| // service-level protocol trait was tried but doesn't work: | ||
| // codegen-generated services may carry no traits on the | ||
| // service schema (the protocol shows up only on operations | ||
| // and members). |
Author
There was a problem hiding this comment.
Not a fan of the approach here.. need a bit more thought
Mounts Smithy operations on Quarkus's Vert.x HTTP server via a new upstream :server:server-vertx-bridge module — no separate Smithy listener. Replaces the experimental @produces Server shape with @produces Service. Upstream (smithy-java) * server-vertx-bridge: SmithyServiceBridge.bridge(services).bind(router) plus BoundBridge (unbind / shutdown) and BridgeOptions (path-prefix, workers, shutdown-grace). Routes are derived per operation; multi-protocol same-path requests (rpcv2-cbor + rpcv2-json on /service/X/operation/Y) collapse into one route that picks protocol by smithy-protocol header. * ServerProtocol.enumerateRoutes() + RouteSpec record. restJson1 uses @http(method, uri); rpcv2 computes /service/<Name>/operation/<Op> and skips services whose operations carry @http traits (avoids phantom mounts). * server-api package promoted out of @SmithyUnstableApi; bridge consumers now see a stable surface. * BasicServiceExample under examples/end-to-end demonstrating the bridge against plain Vert.x (no Quarkus). quarkus-smithy extension * SmithyVertxRecorder + SmithyProcessor mount the bridge on mainRouter at RUNTIME_INIT, register unbind/shutdown tasks, and short-circuit silently when no @produces Service beans exist (ADR-0006 OQ7). * SmithyServerConfig (@ConfigMapping prefix=quarkus.smithy.server) exposes path-prefix, workers, shutdown-grace. * UnremovableBeanBuildItem retains user @produces Service beans. examples/quarkus-server (canonical example) * Standalone Gradle build (its own gradlew) that consumes smithy-java only via mavenLocal — required because Quarkus workspace discovery would otherwise substitute sibling raw build/classes for json-codec's shaded jar and split the classloader graph. * Service-bean producer for CoffeeShop; full Dev & Test guide in README (boot, curl probes, hot reload, path-prefix, packaged jar, Dev UI, integration tests). Cleanup * Delete examples/quarkus-types and examples/quarkus-client. The extension is server-only today; Typed-client and Types-only are documented as future directions in README.md and CONTEXT.md but no longer ship as supported user-facing programming models. * Delete the experimental SmithyServerLifecycle observer (@produces Server path). * Drop the implementation-plan doc; ADR-0006 §Implementation is now the canonical record. * settings.gradle.kts no longer includes :examples:quarkus-{server, client,types} (server is intentionally standalone). Verification * :server:server-vertx-bridge:test 16/16 * :quarkus-smithy-integration-tests:test green * :aws:server:aws-server-restjson:integ + rpcv2 integ green * Prod jar smoke (java -jar quarkus-run.jar): GET /menu 200, PUT /order 200, GET /order/:id 200, GET /no-such 404 with correct payloads * Dev mode (quarkusDev): same four probes pass; hot reload works via BoundBridge.unbind()
Author
|
Looks like there might be major flaw with the multi Vert.x routes mount approach which violate https://smithy.io/2.0/guides/wire-protocol-selection.html after chatting with Adwait. Doing another iteration... |
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.
Issue #, if available: N/A, supersede #1196 since we decide to go single/unified server approach with shared transport first.
Description of changes:
(
/q/health,/q/dev-ui) share the same listener.over HTTP/2; wire-version negotiation is delegated entirely to
quarkus-vertx-http.(method, path),so rpcv2-cbor + rpcv2-json sharing a path collapse into one Vert.x route
whose dispatcher picks the protocol per request via the
smithy-protocolheader.
BoundBridge.unbind()removes every installed routeatomically, supporting Quarkus dev-mode reloads cleanly.
Test plan
:server:server-vertx-bridge:testgreen:quarkus-smithy-integration-tests:testgreen:aws:server:aws-server-restjson:integgreenquarkusBuild→java -jar quarkus-run.jar,probes
GET /menu,PUT /order,GET /order/:id,GET /no-suchreturning
200 / 200 / 200 / 404with correct payloadsquarkusDev, same four probes pass; hot reloadverified via `BoundBridge.unbind()
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.