ObjectStackObjectStack

Dispatcher

Dispatcher protocol schemas

HttpDispatcher Protocol

Defines how the ObjectStack HttpDispatcher routes incoming API requests

to the correct kernel service based on URL prefix matching.

The dispatcher is the central routing component that:

  1. Matches incoming request URLs against registered route prefixes

  2. Delegates to the corresponding CoreService implementation

  3. Returns 503 Service Unavailable when a service is not registered

  4. Supports dynamic route registration from plugins via contributes.routes

Architecture alignment:

  • Kubernetes: API server aggregation layer

  • Eclipse: Extension registry routing

  • VS Code: Command palette routing

Source: packages/spec/src/api/dispatcher.zod.ts

TypeScript Usage

import { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api';
import type { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api';

// Validate data
const result = DispatcherConfig.parse(data);

DispatcherConfig

Properties

PropertyTypeRequiredDescription
routesObject[]Route-to-service mappings
fallbackEnum<'404' | 'proxy' | 'custom'>Behavior when no route matches
proxyTargetstringoptionalProxy target URL when fallback is "proxy"

DispatcherRoute

Properties

PropertyTypeRequiredDescription
prefixstringURL path prefix for routing (e.g. /api/v1/data)
serviceEnum<'metadata' | 'data' | 'auth' | 'file-storage' | 'search' | 'cache' | 'queue' | 'automation' | 'graphql' | 'analytics' | 'realtime' | 'job' | 'notification' | 'ai' | 'i18n' | 'ui' | 'workflow'>Target core service name
authRequiredbooleanWhether authentication is required
criticalityEnum<'required' | 'core' | 'optional'>Service criticality level for unavailability handling
permissionsstring[]optionalRequired permissions for this route namespace

On this page