Skip to content

Chain subscription outputs #216

@scothis

Description

@scothis

Expected Behavior

A subscriber should be able to return a new (or transformed) event that is then sent to a new destination by the bus.

Actual Behavior

The bus ignores the payload returned from a dispatched event, only the status code is considered.

Additional Info

The subscription resource can be augmented to include an Output property that has the same form as Subscriber. The bus MessageDispatcher can redispatch the response to the output destination. If the output destination is a channel, then a new subscription can forward the message on to the next hop creating a chain. ( -> Channel -> Bus -> Function -> Channel -> Bus -> Function -> ...)

This model was demonstrated by @markfisher during the Eventing WG call on June 27th.

While the function that receives the original event is technically able to create new events within the system, this is architecturally suboptimal for a few reasons:

  1. the function response is blocked while dispatching the new event
  2. the function must know where to send the event, which violates the single responsibility principle
  3. the function must know how to communicate with the target destination, yet another violation of the single responsibility principal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions