Skip to main content

Configuration

vendor-connectivity has three binaries (cmd/api, cmd/mcp, cmd/a2a) and each is configured only through environment variables. There is no config file, no flag and no secret-manager integration in the repository. REST, MCP and A2A are unauthenticated fleet-wide, so there is no token or key to configure; access control is the in-cluster network boundary.

The context runs on real Postgres and (in cmd/api) real Kafka only. Anything it cannot run without is a boot error that names the variable, raised before a connection is opened or the listener binds. Test-only variables do not exist in this repository (the integration tests start their own containers).

The tables below list every variable each binary reads. A variable read by several binaries has a row in each table with that binary's own default.

cmd/api​

Source: cmd/api/main.go (loadRuntime, parseSettings, run), cmd/api/telemetry.go, internal/adapters/outbound/telemetry/telemetry.go.

VariableDefaultRequired?Meaning
HTTP_ADDR:8080noListen address of the Vendor REST API (also serves /healthz and /readyz).
DATABASE_URLnoneyesPostgres DSN (the pooled one). Missing = boot error DATABASE_URL is required: this context runs on real Postgres, there is no in-memory mode. Embedded migrations run at boot; repositories, outbox and the Idempotency-Key store live here.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect (non-pooled) DSN used only for the boot migrations, because golang-migrate holds a session advisory lock that does not survive transaction pooling. Empty = DATABASE_URL.
KAFKA_BROKERSnoneyesComma-separated broker list (entries trimmed, blanks dropped). Missing = boot error KAFKA_BROKERS is required: this context runs on real Kafka. Used by the five consumers, the outbox relay and the /readyz metadata check. In the fleet's kind cluster the single broker is localhost:9092 from the host.
EVENT_PUBLISHERkafkanoOnly kafka (or empty) is accepted. log is a boot error (EVENT_PUBLISHER=log is not supported); any other value is a boot error. The variable stays because deployment manifests set it.
NODE_CONSUMER_GROUPnoneyesStable Kafka consumer group id of the node-topology consumer. Missing = boot error NODE_CONSUMER_GROUP is required: the consumer always runs on real Kafka.
LISTING_CONSUMER_GROUPnoneyesGroup id of the offer-availability listing consumer.
SOURCING_CONSUMER_GROUPnoneyesGroup id of the order-sourcing consumer.
INBOUND_CONSUMER_GROUPnoneyesGroup id of the seller-inbound shipment consumer (ADR 0005).
PACKAGING_CONSUMER_GROUPnoneyesGroup id of the catalogue-packaging consumer (offer-availability topic, ADR 0005).
NODE_TOPOLOGY_URLnoneyesBase URL of node-topology (node registration, operational profiles). Missing = boot error NODE_TOPOLOGY_URL is required: the in-organization call it names has no default.
OFFER_AVAILABILITY_URLnoneyesBase URL of offer-availability (inventory feeds).
SHIPPING_AND_TRACKING_URLnoneyesBase URL of shipping-and-tracking (labels).
NODE_PERFORMANCE_URLnoneyesBase URL of node-performance (scorecards).
TX_PROCESSING_DELAY0noLeast time a submission stays PROCESSING. A Go duration (500ms); zero is allowed, negative or unparsable is a boot error. Simulation knob, keep unset in normal operation.
TX_FAILURE_RATE0noShare (0..1) of submissions that fail on purpose with ErrSimulatedFailure. Out of range is a boot error. Simulation knob.
PO_REDELIVERY_RATE0noChance (0..1) that a purchase-order poll page repeats its first order. Out of range is a boot error. Simulation knob.
RATE_LIMIT_RPS0noRequests per second over /vendor/*; 0 = unlimited. Negative or unparsable is a boot error.
SUBMISSION_POLL_INTERVAL1snoHow often the submission processor handles due submissions. A positive Go duration; invalid or 0 is a boot error.
EXPIRY_SWEEP_INTERVAL30snoHow often the expiry sweeper expires orders not acknowledged by ackBy. A positive Go duration; invalid or 0 is a boot error.
OUTBOX_RELAY_INTERVAL1snoPause between relay passes. A Go duration or plain seconds (2, 0.5). Unparsable or non-positive logs a WARN and uses the default.
OUTBOX_MAX_ATTEMPTS20noFailures after which the relay stops claiming an outbox row. 0 = unlimited. Negative or unparsable logs a WARN and uses 20.
SHUTDOWN_DRAIN_DELAY5snoAfter SIGINT/SIGTERM /readyz flips to 503 and the process waits this long before closing the listener. 0 disables the wait. Negative or unparsable logs a WARN and uses 5s. Read when the signal arrives.
LOG_LEVELinfonodebug, info, warn (or warning), error, case-insensitive; other values fall back to info. Logs are JSON on stdout.
OTEL_SERVICE_NAMEvendor-connectivitynoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noCollector OTLP/gRPC endpoint, host:port or full URL (a bare host:port becomes http://host:port). Export never blocks: an absent Collector costs telemetry, never availability.
SERVICE_VERSIONdevnoservice.version resource attribute.
ENVIRONMENTlocalnodeployment.environment.name resource attribute.

Misconfiguration is refused one variable at a time (the first problem found is returned), for example with an empty environment:

DATABASE_URL is required: this context runs on real Postgres, there is no in-memory mode

With the mandatory variables set, the five consumers, the three loops and the outbox relay all start; nothing is switched off by configuration.

cmd/mcp​

Source: cmd/mcp/main.go, cmd/mcp/telemetry.go. Read-only MCP over Streamable HTTP; it starts no relay, consumer or loop and never dials Kafka (ADR 0006).

VariableDefaultRequired?Meaning
MCP_ADDR:8090noListen address of the MCP server.
DATABASE_URLnoneyesPostgres DSN of the service database cmd/api owns. Missing = boot error DATABASE_URL is required: this context runs on real Postgres.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the idempotent boot migrations (the MCP binary can boot on a fresh database before cmd/api has).
NODE_TOPOLOGY_URLnoneyesThe shared Service is built with all four neighbour clients, so all four URLs are required, as in cmd/api.
OFFER_AVAILABILITY_URLnoneyesAs above.
SHIPPING_AND_TRACKING_URLnoneyesAs above.
NODE_PERFORMANCE_URLnoneyesAs above; get_node_scorecard relays the scorecard from node-performance.
LOG_LEVELinfonoAs cmd/api.
OTEL_SERVICE_NAMEvendor-connectivity-mcpnoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs cmd/api.
SERVICE_VERSIONdevnoAs cmd/api.
ENVIRONMENTlocalnoAs cmd/api.

cmd/a2a​

Source: cmd/a2a/main.go, cmd/a2a/telemetry.go. Read-only A2A agent over JSON-RPC 2.0; no relay, consumer, loop or Kafka (ADR 0009).

VariableDefaultRequired?Meaning
A2A_ADDR:8093noListen address of the A2A server.
A2A_AGENT_URLnoneyesAbsolute http(s) URL the Agent Card advertises for the JSON-RPC endpoint. Missing = boot error A2A_AGENT_URL is required: the Agent Card advertises it and it has no default; relative or non-http(s) = A2A_AGENT_URL must be an absolute http(s) URL.
DATABASE_URLnoneyesPostgres DSN of the service database.
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDirect DSN for the boot migrations.
NODE_TOPOLOGY_URLnoneyesSame four required neighbour URLs as cmd/mcp.
OFFER_AVAILABILITY_URLnoneyesAs above.
SHIPPING_AND_TRACKING_URLnoneyesAs above.
NODE_PERFORMANCE_URLnoneyesAs above; the get_node_scorecard skill relays from node-performance.
LOG_LEVELinfonoAs cmd/api.
OTEL_SERVICE_NAMEvendor-connectivity-a2anoservice.name of spans and metrics.
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs cmd/api.
SERVICE_VERSIONdevnoAs cmd/api.
ENVIRONMENTlocalnoAs cmd/api.

Readiness​

GET /readyz on cmd/api is 200 only when the shutdown drain gate is open and Postgres answers a ping and a Kafka broker answers a metadata request that names no topic (reachability only). The verdict is cached for 3 s and a round of checks is bounded by 2 s. A failed dependency is 503 application/problem+json (dependency-unavailable). /healthz is liveness only. Topics are not part of readiness: the relay writer sets AllowAutoTopicCreation, so the broker creates a topic on first write, and a consumed topic that does not exist yet only shows as consumer retry logs. Source: internal/adapters/inbound/http/readiness.go, cmd/api/main.go (newReadiness).

Compiled-in settings (not configurable)​

SettingValueSource
HTTP ReadHeaderTimeout5 s (all three binaries)cmd/*/main.go
HTTP graceful shutdown / per-worker drain timeout10 s / 10 s (cmd/api); 10 s (cmd/mcp, cmd/a2a)cmd/api/main.go (shutdownTimeout, workerDrainTimeout)
Retention sweep interval24 hcmd/api/main.go (retentionSweep)
Postgres pool10 connections, statement_timeout set per connectioninternal/adapters/outbound/postgres/pool.go
Boot retry (migrations, first ping)5 attempts, backoff 1 s, 2 s, 4 s, 8 s (15 s total), then the process refuses to bootinternal/bootretry/bootretry.go
Outbox relay batch size100 rows per passinternal/adapters/outbound/outbox/relay.go (DefaultBatchSize)
Kafka producerno fixed topic, AllowAutoTopicCreationinternal/adapters/outbound/kafka/writer.go
Submission attemptsa submission may end 5 passes without an outcome (an outage, or a refusal the callee releases for a retry, ADR 0016) before it fails with ErrUpstreamUnavailable (or with the refusal's own Err... code); page size 50 (max 200); processed submissions kept 30 daysinternal/application/usecases/service.go
Idempotency-Key replay window24 hinternal/adapters/inbound/http/idempotency.go (IdempotencyTTL)
Topics producedretailnetwork.vendor-connectivity.events, retailnetwork.vendor-connectivity.analyticsinternal/adapters/outbound/kafka/encoder.go
Topics consumedretailnetwork.node-topology.events, retailnetwork.offer-availability.events, retailnetwork.order-sourcing.events, retailnetwork.seller-inbound.events, retailnetwork.customer-returns.eventsinternal/adapters/inbound/kafka/consumers.go, inbound_consumers.go, returns_consumers.go
Dead-letter topic<topic>.dlqinternal/adapters/inbound/kafka/deadletter.go

What is deliberately absent​

  • No auth variables on REST, MCP or A2A.
  • No Kafka variables on cmd/mcp and cmd/a2a: they never publish or consume.
  • No CORS or feature-flag variables.
  • Chart values. charts/vendor-connectivity maps the cmd/api variables onto the pod (see Runbook); the chart deploys cmd/api only.