how can I connect an existing tcp connection on node-red with a java application through a JSON file

hello.
how can I connect an existing tcp connection on node-red with a java application through a JSON file?

I have a tcp connection on node-red and I want the info that I get there to be exported as a Json file that a Java application can read, any idea would be helful.

Not sure exactly what you mean… as in what exactly you want to write to the file… but if you just want the payload - then just connect it to a file out node and configure that with a path and filename (if you want a fixed one to monitor) and see what happens.

Of course you may need to convert the payload in some way first - but you haven’t mentioned that.

Note that this question has also been asked on StackOverflow:
https://stackoverflow.com/questions/50336106/how-can-i-connect-an-existing-tcp-connection-on-node-red-with-a-java-application