Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Use nested value from record as key in Kafka
Labels:
- Labels:
-
Apache NiFi
Explorer
Created ‎02-23-2024 04:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
I have some problem with public data on Kafka. I have record to public like this:
{
"name": "Jess",
"surname": "Stone",
"data": {
"mail": "j.stone@gmail.com",
"class": "5",
"address": {
"country": "Brasil",
"city": "Rio de Janeiro"
}
},
"anotherData": {
"sex": "female",
"code": "1220"
}
}
I need set code value as key so I set it like
Message Key Field sex
But it doesn't works, i think it is possible that it doesn't work because this value is nested-when I set for example name it works. Maybe you know how can I set these nested value from this record to Message Key Field? I tried something like this: anotherData.sex but it doesn't work too...
1 REPLY 1
Super Collaborator
Created ‎03-05-2024 12:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you considered using EvaluateJSONPath to extract the value as a FlowFile attribute and then use that for your key when publishing to Kafka?
