Code Monkey home page Code Monkey logo

Comments (5)

komamitsu avatar komamitsu commented on May 24, 2024

TCPSender doesn't use any heartbeat by default. But if you set up a Fluency using Fluency.defaultFluency(List<InetSocketAddress> servers, Config config), TCPSender uses TCPHeartbeater internally for quick failover.

from fluency.

jondoe1337 avatar jondoe1337 commented on May 24, 2024

Is it an issue now or not?

If so - is this the correct way to activate the Heartbeat:

Instantiator heartbeaterConfig = new TCPHeartbeater.Config().setHost(serverIp).setPort(serverPort);

Config senderConfig = new TCPSender.Config().setHost(serverIp).setPort(serverPort).setHeartbeaterConfig(heartbeaterConfig);

RetryableSender retryableSender = new RetryableSender.Config(senderConfig).createInstance();

Fluency logger = new Fluency.Builder(retryableSender).build();

from fluency.

jondoe1337 avatar jondoe1337 commented on May 24, 2024

What also looks strange is the Heartbeat implementation itself:
org.komamitsu.fluency.sender.heartbeat.TCPHeartbeater.invoke()
Why are you opening and closing a SocketChannel? This operation is very expensive, instead of just activating a keep-alive.

from fluency.

komamitsu avatar komamitsu commented on May 24, 2024

@jondoe1337

Is it an issue now or not?

I don't think it's an issue. But if you want to use a heartbeat even when using only one Fluentd, the way you wrote to construct a Fluency instance should work. Maybe I'd better make org.komamitsu.fluency.Fluency#defaultFluency(host, port) use a heartbeat.

Why are you opening and closing a SocketChannel? This operation is very expensive

It's the same way as Fluentd's out_forward plugin. How much is it expensive at 1 sec interval comparing to TCP keep alive?

from fluency.

jondoe1337 avatar jondoe1337 commented on May 24, 2024

Okay, you are right - I might have used it the wrong way.

from fluency.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.