ADR 0003: Consumed contracts and the local CatalogItemView
Status
Accepted (2026-10-25).
Context
Pricing must know whether a catalogue item exists and is not discontinued before it prices it, without calling offer-availability.
Decision
-
Pricing consumes two events from
retailnetwork.offer-availability.events, under the consumer group inOFFER_AVAILABILITY_CONSUMER_GROUP(mandatory):com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreatedcom.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinued
Only
data.catalogItemIdis used; other fields are ignored. -
They feed the local CatalogItemView.
CatalogItemDiscontinuedalso runs the policy WithdrawOnDiscontinue: an ACTIVE price of the item is withdrawn andItemPriceWithdrawnpublished, in the same transaction as the view update. -
Consumers claim the CloudEvents
idin an inbox inside the unit of work, dispatch on the fulltypestring and ignore unknown types and flat legacy messages. -
A payload that can never be applied (an invalid id, a wrong shape) goes to the dead-letter topic and the offset is committed; a transient failure is retried.
-
Pricing never calls a sibling over HTTP.
Consequences
Creating a price for an item the consumer has not yet seen is refused with
unknown-catalog-item; clients retry after the event is projected.