messagequeue

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Stovepipe internal message-queue contract

Wire payloads for the queues internal to the Stovepipe pipeline. It is internal — used only within the Stovepipe domain — so it lives under stovepipe/core rather than api/ (Bazel visibility keeps it domain-scoped).

Payloads are defined in proto3 (proto/, generated into protopb/) and serialized as protobuf JSON (protojson), so the MySQL-backed queue keeps storing self-describing JSON. The contract package adds only generic glue — Marshal/Unmarshal and the TopicKeys reflection lookup — and owns the TopicKey constants for the stages it carries. Each payload declares the topic key(s) that carry it via the topic_keys proto option (defined in api/base/messagequeue); a contract test round-trips every payload and asserts each topic key is bound to exactly one message.

Stages

  • process (TopicKeyProcess, ProcessRequest) — ingest publishes the minted request id here once it accepts a new head; the process controller reloads the Request from storage and decides the build strategy. Only the id travels: producer and consumer share the store, so messages stay small and redelivery is idempotent.

See doc/rfc/messagequeue-contract.md for the contract conventions and api/runway/messagequeue for the external reference example.

Documentation

Overview

Package messagequeue holds Stovepipe's internal message-queue contract: the wire payloads for the pipeline queues Stovepipe owns, defined by the proto files in proto/ and generated into protopb/. The proto is the language-neutral authority; the generated Go types in protopb are the binding for Go callers.

It is internal — used only within the Stovepipe domain — so it lives under stovepipe/core rather than api/. The message types are generated into protopb; this package adds only generic protojson glue (Marshal/Unmarshal) and the topic-key reflection lookup (TopicKeys), so there is no per-message serialization code. Payloads are serialized as protobuf JSON, not binary, so the MySQL-backed queue keeps storing self-describing JSON. The topic key that carries each payload is declared on the message itself via the topic_keys proto option (see api/base/messagequeue).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(m proto.Message) ([]byte, error)

Marshal serializes any contract message to protojson bytes for the queue payload, keeping the proto field names (snake_case) on the wire.

func TopicKeys

func TopicKeys(m proto.Message) []string

TopicKeys returns the stable logical topic keys bound to a message via the topic_keys proto option — not concrete wire names; a caller maps each key to its backend's topic name. Returns nil for a message that declares no keys.

func Unmarshal

func Unmarshal[T proto.Message](b []byte, m T) error

Unmarshal deserializes protojson bytes into the contract message m, tolerating unknown fields so an additive contract change is ignored rather than rejected.

Types

type ProcessRequest

type ProcessRequest = protopb.ProcessRequest

ProcessRequest is the payload ingest publishes to the process stage: the minted request id to validate.

type TopicKey

type TopicKey = consumer.TopicKey

TopicKey is the typed identifier used to look up a queue backend, topic name, and subscription config in a consumer.TopicRegistry. The constants below are the logical topic keys for Stovepipe's internal pipeline stages; they are the same strings each message lists in its topic_keys option.

const (
	// TopicKeyProcess carries newly accepted requests from ingest to the process
	// stage. ingest publishes a ProcessRequest (the request id) here; the process
	// controller consumes it, reloads the Request, and decides the build strategy.
	TopicKeyProcess TopicKey = "process"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL