Skip to content

via-on-sync

via or channel on a sync Relationship.

Severity: error · Since: v1.0.0

For the failing example below, archidocs check prints:

shop/services.yaml:6:9 error via-on-sync `via` is only for an async Relationship; add `interaction: async` or remove `via`
shop/services.yaml:7:9 error via-on-sync `channel` is only for an async Relationship; add `interaction: async` or remove `channel`

via and channel say which broker and channel carry a Publisher’s events to a Subscriber. A sync Relationship is a call that waits for an answer, with no broker in it, so they would add a hop that isn’t there to impact and path answers.

shop/services.yaml:

services:
web:
name: Web
relationships:
- to: cart
via: events
channel: cart.updated
cart:
name: Cart
events:
name: Events
type: broker

Set interaction: async if the Relationship runs through a broker, or remove via and channel.

shop/services.yaml:

services:
web:
name: Web
relationships:
- to: cart
interaction: async
via: events
channel: cart.updated
cart:
name: Cart
events:
name: Events
type: broker
  • via-not-broker: via names a Service that isn’t type: broker.
  • return-on-async: A Dynamic View return Step resolves to an async Relationship, which has no reply.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.