Fluentd Exception handling

246 views
Skip to first unread message

shailu_comcast

unread,
Oct 2, 2013, 9:43:22 AM10/2/13
to flu...@googlegroups.com

Hello Everyone,


I have couple questions. I am new to fluentd.
How I am supposed to do exception handling in fluentd. I am trying to connect to remote fluentd.I wanted to see if connection is established to fluentd, if connection not established I wanted to connect next available fluentd instance.
What are options available for forwarding and shuffling between different fluentd instances. 

For example when I am connected to fluentd I can't see open() method in fluentd, I can only see in the console if connection established or not.

Thanks in advance.


Thanks,
Shailu.

Eduardo Aceituno

unread,
Oct 2, 2013, 9:51:39 AM10/2/13
to flu...@googlegroups.com
I think that "Log Forwarder Configuration" (http://docs.fluentd.org/articles/high-availability) may be right for you.

Regards


2013/10/2 shailu_comcast <shaila...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

shailu_comcast

unread,
Oct 2, 2013, 10:31:03 AM10/2/13
to flu...@googlegroups.com
Problem I am facing is, I am not using fluentd instance running on my server.
I am just pushing some data through Java code by connecting to remote fluentd.

Example: 
FluentLogger LOG = FluentLogger.getLogger(app, FLUENTD_ADDRESS, FLUENTD_PORT);
I connect to remote fluentd like this.
and just pushing some data using map.

This way I am connected to only one fluentd remote instance.
what if it fails to connect due to network failure. my messages are lost. Funny thing about it I am not able to catch exception if connection not established cause Java compiler doesnt understand it.
It's just displaying in the console couldn't connect but its not going to catch block.


Can you please share your ideas on this.

Thanks in advance.

Eduardo Aceituno

unread,
Oct 2, 2013, 11:52:08 AM10/2/13
to flu...@googlegroups.com
There is a buffer to keep pending bytes to be sended after a reconnection (https://github.com/fluent/fluent-logger-java/blob/master/src/main/java/org/fluentd/logger/FluentLoggerFactory.java#L47) so your messages isn't lost at all. I search in the code and I didn't found anything to catch exceptions at high level. All exceptions (IOException) are catched and not propagated. Perhaps an HAProxy in front of your flluentd instances can solve your problem. I can't offer more help.

Regards


2013/10/2 shailu_comcast <shaila...@gmail.com>

shailu_comcast

unread,
Oct 2, 2013, 12:57:11 PM10/2/13
to flu...@googlegroups.com
Thank you :)
Reply all
Reply to author
Forward
0 new messages