Skip to main content

Event catalogue

Node Topology publishes ten events and consumes none. The contract is apis/asyncapi.yaml (AsyncAPI 3.0.0); the types are catalogued in ADR 0004 and TestEventCatalogueMatchesContract fails the build if the two drift. Every field with its example is on Domain events; this page is the reference for consumers.

Channel and envelope​

ItemValue
Topicretailnetwork.node-topology.events (the only topic; nothing is published on an analytics topic)
Publisherthe outbox relay in cmd/api, acks=all, hash partitioner
Kafka keythe CloudEvents subject: nodeId, laneId, postalPrefix or regionId, so one aggregate's events stay ordered on one partition
Kafka headercontent-type: application/cloudevents+json; charset=UTF-8, plus traceparent when the write had a span
ModeCloudEvents 1.0, structured
Required attributesspecversion 1.0, id (UUID), source /retailnetwork/node-topology, type, subject, time (RFC 3339 UTC), datacontenttype application/json, dataschema urn:retailnetwork:node-topology:events:<EventName>:v1, data
Type patterncom.retailnetwork.logistics.node-topology.<entity>.<EventName>, entity node, lane, servicearea or region
data conventionscamelCase; timestamps RFC 3339 UTC; local times HH:mm in the declared timezone; optional fields omitted when unset except the three nullable NodeRegistered fields

Sources: internal/adapters/kafka/cloudevents/cloudevents.go, internal/adapters/outbound/kafka/encoder.go, payloads.go.

Types​

EventFull typeSubject and keyRaised bydata fields
NodeRegisteredcom.retailnetwork.logistics.node-topology.node.NodeRegisterednodeIdRegisterNodenodeId, nodeType, subtype (null unless a fulfilment centre), operator, vendorId and vendorNodeCode (null for network nodes), regionId, timezone, postalCode, countryCode
NodeOperationalProfileDeclaredcom.retailnetwork.logistics.node-topology.node.NodeOperationalProfileDeclarednodeIdDeclareOperationalProfilenodeId, profileRevision, timezone, operatingHoursByDay, holidays, handlingTimeMinutes, cutoffs[{localTime, days?, maxOrders?}], throughputCap{value, timeUnit, unit}, sortDwellMinutes?, inbound?, declaredBy
NodeActivatedcom.retailnetwork.logistics.node-topology.node.NodeActivatednodeIdActivateNodenodeId, activatedAt
NodeSuspendedcom.retailnetwork.logistics.node-topology.node.NodeSuspendednodeIdSuspendNodenodeId, reason, suspendedAt
NodeRetiredcom.retailnetwork.logistics.node-topology.node.NodeRetirednodeIdRetireNodenodeId, retiredAt
LaneOpenedcom.retailnetwork.logistics.node-topology.lane.LaneOpenedlaneIdOpenLanelaneId, originNodeId, destinationNodeId, mode, nominalTransitMinutes
LaneClosedcom.retailnetwork.logistics.node-topology.lane.LaneClosedlaneIdCloseLanelaneId, closedAt
LaneCostDeclaredcom.retailnetwork.logistics.node-topology.lane.LaneCostDeclaredlaneIdDeclareLaneCostlaneId, costPerUnitCents, declaredAt
ServiceAreaAssignedcom.retailnetwork.logistics.node-topology.servicearea.ServiceAreaAssignedpostalPrefixAssignServiceAreapostalPrefix, deliveryStationNodeId, regionId, assignmentVersion
RegionDefinedcom.retailnetwork.logistics.node-topology.region.RegionDefinedregionIdDefineRegionregionId, code, name

Field notes​

  • nodeType is one of FULFILLMENT_CENTER, INBOUND_CROSS_DOCK, RETURNS_CENTER, SORTATION_CENTER, DELIVERY_STATION, AIR_HUB; subtype one of SORTABLE, NON_SORTABLE, XL, SOFT_LINES, SUB_SAME_DAY, FRESH, MICRO; operator NETWORK or VENDOR; mode GROUND or AIR; declaredBy VENDOR or NETWORK_OPS; throughputCap.timeUnit HOUR or DAY, unit always ORDER.
  • Capabilities are not on the wire. Derive them from nodeType (policy DefaultCapabilitiesByType).
  • profileRevision strictly increases per node and assignmentVersion strictly increases per prefix: consumers keep the highest.
  • In operatingHoursByDay a weekday that is missing is closed; holidays are ISO dates closed all day; a cutoff without days applies to every operating day; sortDwellMinutes is present only for sortation centres and air hubs.
  • inbound is present only when the revision declares inbound limits; every limit inside it is optional: maxCartonWeightG (grams), maxCartonDimsMm{l, w, h} (millimetres), acceptsPallets, requiresSscc. Absent means unchecked. See ADR 0007.
  • NodeSuspended and NodeRetired do not close the node's lanes or service areas (policy SuspendedEndpointsUnusable): consumers treat them as unusable while the node is not ACTIVE.
  • LaneClosed is final: there is no reopen event; a new lane raises a new LaneOpened.
  • LaneCostDeclared carries costPerUnitCents, integer cents from 0 to 10000000 (0 is a legal declaration); each declaration supersedes the previous value, so keep the latest per laneId. A lane never declared on publishes nothing. See ADR 0014.

Delivery guarantees and consumer rules​

  • At least once. The relay may republish a row after a crash; the id is minted once, at append, and stored with the row, so a duplicate carries the same id. Deduplicate on it.
  • Ordering. Per aggregate, by key, while the relay is healthy. A row that reaches the attempt cap (OUTBOX_MAX_ATTEMPTS, default 20) is skipped and later rows overtake it until it is re-armed; this is why consumers keep the highest revision or version instead of trusting arrival order.
  • Dispatch on the full type; ignore unknown types. A breaking payload change is a new .v2 type, never a mutation of v1.
  • No replay API. The topic is the history; republishing means re-arming an outbox row (runbook).

Who subscribes, and to which events, is on Integration.