-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditionRulesExample.json
23 lines (23 loc) · 1.64 KB
/
conditionRulesExample.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"subject": "customer-avro-value",
"metadata": {
"properties": {
"email": "[email protected]",
"owner": "Jan Svoboda"
}
},
"schema": "{\r\n \"type\": \"record\",\r\n \"namespace\": \"com.github.griga23\",\r\n \"name\": \"Customer\",\r\n \"version\": \"1\",\r\n \"fields\": [\r\n { \"name\": \"first_name\", \"type\": \"string\", \"doc\": \"First Name of Customer\" },\r\n { \"name\": \"last_name\", \"type\": \"string\", \"doc\": \"Last Name of Customer\" },\r\n { \"name\": \"age\", \"type\": \"long\", \"doc\": \"Age at the time of registration\" },\r\n { \"name\": \"phone\", \"type\": \"long\", \"default\": 0, \"doc\": \"Phone number\" },\r\n { \"name\": \"height\", \"type\": \"double\", \"doc\": \"Height at the time of registration in cm\" },\r\n { \"name\": \"weight\", \"type\": \"double\", \"doc\": \"Weight at the time of registration in kg\" },\r\n { \"name\": \"automated_email\", \"type\": \"boolean\", \"default\": true, \"doc\": \"Field indicating if the user is enrolled in marketing emails\" },\r\n {\r\n \"name\": \"gender\",\r\n \"default\": \"UNKNOWN\",\r\n \"type\": {\r\n \"default\": \"UNKNOWN\",\r\n \"name\": \"Gender\",\r\n \"symbols\": [\r\n \"MALE\",\r\n \"FEMALE\",\r\n \"UNKNOWN\"\r\n ],\r\n \"type\": \"enum\"\r\n }\r\n }\r\n ]\r\n}",
"ruleSet": {
"domainRules": [
{
"name": "checkAge",
"kind": "CONDITION",
"mode": "WRITE",
"type": "CEL",
"expr": "message.age > 18",
"onFailure": "DLQ",
"disabled": false
}
]
}
}