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:
- the function response is blocked while dispatching the new event
- the function must know where to send the event, which violates the single responsibility principle
- the function must know how to communicate with the target destination, yet another violation of the single responsibility principal
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
Outputproperty that has the same form asSubscriber. 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: