Multi-Protocol VHost Support for Event Gateways #2098
ShalkiWenushika
started this conversation in
Ideas
Replies: 2 comments
-
|
Suggesting a 3rd option: Option 3 — Flat
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
We have decided to proceed with Option 3: migrate the data from the current vhost column to the newly added endpoints column, and then remove the vhost column from the database. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
The Gateway schema in the Admin REST API currently defines a single vhost string field to represent the public-facing hostname of a self-hosted gateway. While this works for gateways that serve a single protocol, the new WebBroker API type introduces multi-protocol support. APIs deployed on an event gateway can be accessed over HTTPS, WSS, SSE, and other web-friendly protocols, each potentially using a different port.
A single string field cannot capture protocol-specific port information, making it impossible for consumers to discover the correct endpoint for a given protocol.
Current State
The Gateway schema (in admin-api.yaml) defines:
This means all protocols served by a gateway share the same hostname with no way to differentiate ports.
Options
Option 1 — Reuse and extend the existing VHost schema
The Environment schema already solves this problem by using a vhosts array of VHost objects, where each VHost carries protocol-specific port fields (httpPort, httpsPort, wsPort, wssPort).
The simplest solution is to replace the flat
vhost: stringfield in the Gateway schema with a reference to the sameVHostschema and extend VHost with port fields for any additional protocols that need to be supported.Pros: Consistent with how Environment handles vhosts. No new schemas introduced. Extending VHost with ssePort also benefits environments if SSE support is needed there too.
Cons: Reusing the shared VHost schema for a gateway-specific requirement may not be ideal. It also mixes environment-level vhost details with gateway registration details, which represent different concerns.
Option 2 — Introduce a new GatewayVHost schema
Define a structured vhost type specific to the Gateway resource, keeping it decoupled from the Environment's VHost schema:
Pros: Clean separation of concerns. Gateway vhost requirements evolve independently from environment vhosts. New protocols for new API types can be added without touching VHost.
Cons: Introduces a new schema that largely duplicates VHost.
Recommendation
Option 2 — introduce a dedicated GatewayVHost schema.
The Gateway resource is conceptually different from Environment: it represents a self-hosted gateway registered against the admin plane, not a managed deployment environment. Their vhost semantics will likely diverge further as new gateway types are introduced with their own supported protocols.
Extending the shared VHost schema (Option 1) risks coupling these two concerns. A dedicated GatewayVHost gives a clean, evolvable contract for gateway registration without affecting existing schemas.
As a starting point,
GatewayVHostcan mirror the structure ofVHost, while allowing additional protocol-specific fields to be added in the future. With this approach, support for new protocols and API types would only require extending a single schema.However, this schema change will require updates to the UI calls and DB for other self-hosted gateways as well.
Appreciate any feedback here before we proceed with the schema changes and implementation.
Beta Was this translation helpful? Give feedback.
All reactions