Skip to content

Configuration Events Interface

VERSION: v1 (Cache Invalidation Broadcast)

Section titled “VERSION: v1 (Cache Invalidation Broadcast)”

Asynchronous pub/sub event interface leveraging Spring Cloud Bus over a RabbitMQ topic exchange to broadcast cache invalidation signals (ConfigurationChangedEvent) to consumer microservices across the AirCommerce platform.

When a configuration update is committed, the Configuration Service determines the destination pattern dynamically based on the configuration namespace:

String destinationService = String.format("%s:**", namespace);

Microservice instances whose Spring Cloud Bus service ID or registered namespaces match this wildcard pattern (e.g., booking:**, common:**) consume the event, while instances belonging to unaffected domains ignore it. Consuming microservices using the util-configuration library leverage BusMatcherConfig to dynamically bridge their declared aircommerce.configuration.namespaces into Spring Cloud Bus’s ServiceMatcher, ensuring multi-namespace consumers receive targeted events without manual alias configuration (ADR 0006).

Event Contract (ConfigurationChangedEvent)

Section titled “Event Contract (ConfigurationChangedEvent)”
Field Type Description
originService String Identifier of the publishing service instance emitting the change
destinationService String Target namespace routing pattern (e.g., booking:**, connectors:**)
key String Canonical key of the configuration parameter that was mutated
action ConfigurationChangeAction Nature of the change: CREATED, UPDATED, or DELETED

The event model includes a @JsonCreator-annotated default constructor to ensure deterministic Jackson deserialization across consuming microservices.

Downstream microservices integrate via the util-configuration library, which automatically registers a Spring Cloud Bus event listener for ConfigurationChangedEvent:

  1. DELETED Action:
    • The consumer evicts the entry associated with key from its in-memory Local Configuration Cache.
    • No subsequent network or HTTP calls are performed (zero-network overhead).
  2. CREATED or UPDATED Action:
    • The consumer purges the existing entry from its Local Configuration Cache.
    • The consumer immediately dispatches a targeted HTTP request (GET /configurations/{key}) to the Configuration API to retrieve and cache the fresh value.

None

Initial Architecture Baseline — 2026-10-12

Section titled “Initial Architecture Baseline — 2026-10-12”

Reason: Asynchronous event interface introduced for cache invalidation broadcast (ADR 0002).

  • Is strictly confidential data (e.g., traveler PII, travel documents, payment data, PCI, credentials) excluded from event payloads whenever unnecessary and feasible? Confirmed: ConfigurationChangedEvent contains only event routing metadata (originService, destinationService, key, action). Configuration payload values are intentionally omitted from event messages.
  • Can the sender’s identity be verified? Verified via RabbitMQ internal credentials, TLS authentication, and secured internal message broker topology.
  • Are there authorization checks preventing cross-application data access beyond what is needed? Enforced via RabbitMQ exchange topic bindings and Spring Cloud Bus namespace filtering.