This is a package for CERK. CERK is an open source CloudEvents Router written in Rust with a MicroKernel architecture.
CERK lets you route your CloudEvents between different different ports. Ports are transport layer bindings over which CloudEvents can be exchanged. It is built with modularity and portability in mind.
CERK comes with a couple of prefabricated components, but implementing custom components is easy.
A good overview is provided on GitHub.
The rule-based router routes events based on the given configuration.
The configurations are structured in a tree format.
One configuration tree per output port needs to be configured.
The operations And
, Or
, Contains
, StartsWith
and more are supported.
The Socket expects a Config::String
as configuration.
The string should be a json deserialized routing_rules::RoutingTable
.
Config::String("{}".to_string())
```rust use serdejson; use cerkrouterrulebased::{CloudEventFields, RoutingRules, RoutingTable};
let routingrules: RoutingTable = [( "dummy-logger-output".tostring(), RoutingRules::And(vec![ RoutingRules::Exact( CloudEventFields::Source, Some("dummy.sequence-generator".tostring()), ), RoutingRules::EndsWith(CloudEventFields::Id, "0".tostring()), ]), )] .iter() .cloned() .collect();
let routingconfigs = serdejson::tostring(&routingrules).unwrap(); ```
The original readme text is a Rust doc comment in the lib.rs file
cargo install cargo-readme
cargo readme > README.md
Apache-2.0