Skip to main content

wire_http_outbound_adapters

Function wire_http_outbound_adapters 

Source
pub fn wire_http_outbound_adapters(rt: &AlloraRuntime) -> Result<()>
Expand description

Subscribe each [HttpOutboundAdapterActivation] with a from: channel name to that inbound channel; dispatch each arriving exchange through the adapter’s .dispatch(&exchange) method.

Mirrors wire_filters for the http-outbound side. Activations with from = None are static-only: the adapter sits on the runtime for application code to invoke directly (see the http-outbound example), but the runtime does not auto-wire it.

§Response shaping

On a successful dispatch, the post-dispatch exchange is forwarded to to: (when set) with:

  • in_msg.payload ← the HTTP response body (as Payload::Text).
  • header dispatch-result.status-code ← the numeric HTTP status.
  • header dispatch-result.acknowledged"true" if the status was 2xx, else "false".

When to: is None, the dispatch is fire-and-forget: the result is logged at debug! and the message is dropped. (This matches the “I just need a webhook delivered” pattern that doesn’t care about the response.)

On a failed dispatch (network error, TLS handshake failure, etc.), nothing is forwarded; the error is logged at error!.