-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support headers Signed-off-by: clyang82 <[email protected]> Test Signed-off-by: clyang82 <[email protected]> * Add tests Signed-off-by: clyang82 <[email protected]> * Address comments Signed-off-by: clyang82 <[email protected]> * fix test errors Signed-off-by: clyang82 <[email protected]> * Change exception to info Signed-off-by: clyang82 <[email protected]> * place headers under meta Signed-off-by: clyang82 <[email protected]> --------- Signed-off-by: clyang82 <[email protected]> Co-authored-by: Alex <[email protected]>
- Loading branch information
1 parent
191d025
commit 1084732
Showing
4 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/integration/event_source_kafka/test_kafka_rules_headers.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- name: test kafka source plugin with the specified header | ||
hosts: localhost | ||
sources: | ||
- ansible.eda.kafka: | ||
topic: kafka-events-plaintext | ||
host: localhost | ||
port: 9092 | ||
offset: earliest | ||
encoding: ascii | ||
rules: | ||
- name: match kafka event | ||
condition: event.meta.headers.foo == "bar" | ||
action: | ||
debug: | ||
msg: "Rule fired successfully with headers" | ||
|
||
- name: stop | ||
condition: event.body == "stop" | ||
action: | ||
shutdown: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters