Search code examples
javatcplogstash

Sending messages from Java to Logstash using TCP


I am sending TCP String messages from Java to Logstash. I do not want to create a new TCP connection for every message but I want to reuse TCP connection. Is it safe to keep one TCP connection and send messages via Socket.write and Socket.flush until one of the method throws IOException and then open new connection?


Solution

  • We have been running this in production for over a year and so far no problems.