'How can I read json from ListenTCP on Nifi
I have a TCP client which writes JSON strings over a TCP port. I added a ListenTCP processor to read data over socket and write it to file (by PutFile processor).
But when client write JSON in its side as follow:
{
"id" : "faa4e780-3221-4260-89e6-e46721c4a42a",
"type" : "Scroll",
"timestamp" : "2022-04-12 16:45:53",
"app" : "App-3"
}
{
"id" : "faa4e780-3221-4260-89e6-e46721c4a42a",
"type" : "Scroll",
"timestamp" : "2022-04-12 16:45:53",
"app" : "App-3"
}
the result will split line by line in ListenTCP and each output is a flow file containing a line not the whole JSON message.
How can I detect a Json object over socket in NiFi.
Solution 1:[1]
there is a parameter
Batching Message Delimiter = \n
set it to something else
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | daggett |
