Development edition · 16 November 2026. Commands using repository paths, Make targets or sample projects require access to the Quinzee source checkout. No public installer is available. Examples use disposable local environments.
14. Service Bus and Functions execution
Service Bus and Functions meet at the public messaging protocol, while keeping
different ownership boundaries. The broker is native C++ inside quinzee.cloud.
Function code executes in a separately operated real Functions host; the broker
does not invoke application code itself.
Broker state and protocol work
src/quinzee_cloud/modules/service_bus/ separates ARM resources, authentication,
the SQLite store, AMQP codec/engine/management and the TLS listener. HTTP and
AMQP operations share durable resource/message state. A store mutex serializes
their access; one AMQP I/O worker serializes Proton events. Successful mutations
are acknowledged after SQLite commit, with WAL and synchronous FULL enabled.
PeekLock ownership survives restart. Settlement checks the current entity and lock token; expired locks permit redelivery, and delivery limits send messages to the dead-letter subqueue. Topic publication atomically creates one copy per existing subscription. Resource limits and unsupported wire formats are enforced at the adapter/store boundaries, rather than trusting the SDK to avoid them.
The optional AMQP listener has its own port and module lifecycle. HTTPS readiness alone does not establish broker connectivity. SAS or bearer authentication is required for entity operations after AMQP negotiation. Private client trust in the SDK fixture retains hostname verification.
Desired state and real function hosts
src/quinzee_cloud/modules/functions/ contains ARM routing, persistent state,
runtime reconciliation and the HTTPS gateway. infrastructure/functions/ owns
image registration, the external Python runtime helper and container packaging.
The cloud does not receive Docker privileges or run submitted code in-process.
The helper consumes validated desired-state mailboxes and executes only local images resolved through an operator registry to immutable IDs. Its private state is outside the cloud data directory. It issues per-app TLS material from a separate constrained CA and authenticates real host readiness before reporting Running. Status must match the current revision; stale status timestamps stop gateway forwarding. Upstream TLS verifies the app hostname even when the connection destination is the helper-selected container IP.
The public gateway forwards only bounded /api/... exchanges. Function-key
enforcement belongs to the real host. Ordinary ARM inventory omits app settings
and keys; authenticated dedicated APIs expose them. The helper owns containers,
while explicit app lifecycle/deletion requests govern their execution/removal.
Stopping the helper or unloading a module does not stop Service Bus triggers.
Tombstones reserve deleted app names and retained private state requires explicit
operator cleanup.
Changes and regression checks
| Changed boundary | Relevant verification |
|---|---|
| Broker resource/auth/store semantics | unit.service_bus through CTest, including concurrent receive and persistence |
| AMQP adapter, TLS, lock settlement or SDK mapping | make service-bus-sdk-test with the locked official .NET client |
| Functions ARM/state/gateway or helper contract | Functions targets registered in tests/CMakeLists.txt |
| Runtime image, worker bindings or reconciliation | make functions-test with the real host and registered local image |
| QHQ inventory/lifecycle | integration.qhq, using public APIs |
The Service Bus fixture locks Azure.Messaging.ServiceBus; the Functions project
locks both worker packages and generated binding-extension dependencies. Keep
both Functions locks in sync when changing bindings. The full fixture checks
HTTP key rejection/success and automatic queue settlement, not merely container
startup. See the testing chapter for runner prerequisites and
profile/security constraints.
The full contracts and limits remain in Service Bus (source checkout required) and Functions (source checkout required). Design rationale is recorded in decision 025 (source checkout required) and decision 026 (source checkout required). The corresponding user walkthroughs explain provisioning, credentials, invocation and safe shutdown.
App Service web apps share the Microsoft.Web provider and external runtime
mailbox, with independent feature admission through web.hosting. Their image
entrypoint, native hostname, readiness probe and constrained CA differ from
Functions. See App Service architecture and verification (source checkout required)
and the implementation record (source checkout required).
The runtime reconciliation chapter follows the Unix file handoff, helper locks, Docker ownership, mounts, cgroups, identity credentials and forced container replacement. Those details explain why stopping the gateway is different from stopping a queue-triggered workload.