Skip to content

ServiceConfig

Defined in: packages/hoppity/src/ServiceBuilder.ts:28

Configuration for a service created via hoppity.service().

connection: ConnectionConfig

Defined in: packages/hoppity/src/ServiceBuilder.ts:30

Connection settings for the RabbitMQ broker


optional defaultTimeout: number

Defined in: packages/hoppity/src/ServiceBuilder.ts:40

Default RPC timeout in ms (defaults to 30_000)


optional delayedDelivery: DelayedDeliveryConfig

Defined in: packages/hoppity/src/ServiceBuilder.ts:55

Configuration for the delayed delivery engine. Only relevant when any declared contracts use delay support.


optional handlers: HandlerDeclaration[]

Defined in: packages/hoppity/src/ServiceBuilder.ts:32

Handler declarations (onEvent, onCommand, onRpc)


optional instanceId: string

Defined in: packages/hoppity/src/ServiceBuilder.ts:38

Unique instance identifier — auto-generated (UUID) if not provided


optional interceptors: Interceptor[]

Defined in: packages/hoppity/src/ServiceBuilder.ts:50

Interceptors applied to all handler and publish operations. Each interceptor can declare inbound (handler wrapping), outbound (publish wrapping), or both. Applied in declaration order — first interceptor is outermost wrapper.


optional logger: Logger

Defined in: packages/hoppity/src/ServiceBuilder.ts:61

Custom logger instance. When provided, replaces the default ConsoleLogger for all build pipeline logging, handler wiring, and outbound method logging. Providing the logger here ensures it is active before any middleware runs — no ordering footgun.


optional publishes: (EventContract<string, string, ZodTypeAny> | CommandContract<string, string, ZodTypeAny> | RpcContract<string, string, ZodTypeAny, ZodTypeAny>)[]

Defined in: packages/hoppity/src/ServiceBuilder.ts:34

Outbound contract declarations (events, commands, RPC calls to send)


optional topology: BrokerConfig

Defined in: packages/hoppity/src/ServiceBuilder.ts:36

Optional raw Rascal BrokerConfig — merged as the base before derived topology layers on top


optional validateInbound: boolean

Defined in: packages/hoppity/src/ServiceBuilder.ts:42

Validate inbound payloads against contract schemas (defaults to true)


optional validateOutbound: boolean

Defined in: packages/hoppity/src/ServiceBuilder.ts:44

Validate outbound payloads against contract schemas (defaults to false)