pub struct EnrichConfig {
pub connector: Template,
pub method: HttpMethod,
pub path: Option<Template>,
pub merge_path: Template,
pub timeout_ms: Template,
pub on_error: EnrichErrorAction,
}Expand description
Configuration for the enrich integration function.
Enrichment calls an external service and merges the response into the message context.
Unknown keys are rejected, as for HttpCallConfig. Note that the
destination field here is merge_path and takes no alias — only
HttpCallConfig::response_path accepts output.
Fields§
§connector: TemplateNamed connector reference. A JSONLogic expression, as
HttpCallConfig::connector; read it through
Self::resolve_connector.
method: HttpMethodHTTP method for the enrichment call
path: Option<Template>Enrichment path, as a JSONLogic expression. Read it through
Self::resolve_path.
Back-compat: path_logic is kept as an alias for the pre-3.9 spelling,
as on HttpCallConfig::path.
merge_path: TemplateDot-path where enrichment data is merged into the message context, as a
JSONLogic expression. Read it through Self::resolve_merge_path.
timeout_ms: TemplateRequest timeout in milliseconds (default: 30000). Read it through
Self::resolve_timeout_ms.
on_error: EnrichErrorActionWhat to do on enrichment failure
Implementations§
Source§impl EnrichConfig
impl EnrichConfig
Sourcepub fn resolve_connector(&self, ctx: &TaskContext<'_>) -> Result<String>
pub fn resolve_connector(&self, ctx: &TaskContext<'_>) -> Result<String>
Sourcepub fn resolve_path(&self, ctx: &TaskContext<'_>) -> Result<Option<String>>
pub fn resolve_path(&self, ctx: &TaskContext<'_>) -> Result<Option<String>>
Resolve the enrichment path. Ok(None) when no path is configured.
§Errors
Sourcepub fn resolve_merge_path(&self, ctx: &TaskContext<'_>) -> Result<String>
pub fn resolve_merge_path(&self, ctx: &TaskContext<'_>) -> Result<String>
Sourcepub fn resolve_timeout_ms(&self, ctx: &TaskContext<'_>) -> Result<u64>
pub fn resolve_timeout_ms(&self, ctx: &TaskContext<'_>) -> Result<u64>
Trait Implementations§
Source§impl Clone for EnrichConfig
impl Clone for EnrichConfig
Source§fn clone(&self) -> EnrichConfig
fn clone(&self) -> EnrichConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more