EventMesh provides powerful core engines (Filter, Transformer, Router) to dynamically process messages. These engines are configured via MetaStorage (Governance Center, e.g., Nacos, Etcd), supporting on-demand loading and hot-reloading.
Before configuration, it is important to understand the specific role of each engine in the message flow:
Filter (The Gatekeeper): Decides “Whether to pass”.
Transformer (The Translator): Decides “What it looks like”.
Router (The Dispatcher): Decides “Where to go”.
The configuration is not in local property files but distributed via the MetaStorage. EventMesh listens to specific Keys based on client Groups.
eventMesh.metaStorage.plugin.type.{EnginePrefix}-{GroupName}.| Engine | Prefix | Scope | Description |
|---|---|---|---|
| Router | router- | Pub Only | Routes messages to different topics. |
| Filter | filter- | Pub & Sub | Filters messages based on CloudEvent attributes. |
| Transformer | transformer- | Pub & Sub | Transforms message content (Payload/Header). |
Scope: Publish Only (Upstream)
Key: router-{producerGroup}
Decides the target storage topic for a message sent by a producer.
[ { "topic": "original-topic", "routerConfig": { "targetTopic": "redirect-topic", "expression": "data.type == 'urgent'" } } ]
Scope: Both Publish (Upstream) & Subscribe (Downstream)
Key: filter-{producerGroup}
Effect: Intercepts messages before they are sent to Storage.
Key: filter-{consumerGroup}
Effect: Intercepts messages before they are pushed to the Consumer.
[ { "topic": "test-topic", "filterPattern": { "source": ["app-a", "app-b"], "type": [{"prefix": "com.example"}] } } ]
Scope: Both Publish (Upstream) & Subscribe (Downstream)
Key: transformer-{producerGroup}
Effect: Modifies message content before sending to Storage.
Key: transformer-{consumerGroup}
Effect: Modifies message content before pushing to the Consumer.
[ { "topic": "raw-topic", "transformerConfig": { "transformerType": "template", "template": "{\"id\": \"${id}\", \"new_content\": \"${data.content}\"}" } } ]
original, template.router-MyGroup.MyGroup.targetTopic in your MQ.