You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by "Krishnan Nair.Praveen" <Pr...@IGT.com> on 2013/10/29 19:16:23 UTC

is NettyAvroRpcClient methods threadsafe - flume component client SDK

Hi,

I would like to know if  NettyAvroRpcClient methods are thread safe , so that same client instancecan be used by multiple threads
to post log events from a java application.

Could you provide an example code snippet that mentions the usage of  NettyAvroRpcClient methods in multithreaded situation?

Also the append method in org.apache.flume.clients.log4jappender.Log4jAppender seems to be synchronised.
Does that create a bottleneck if Log4jAppender is used from application for appending log messages to Flume?

Thanks & Regards,
Praveen


Re: is NettyAvroRpcClient methods threadsafe - flume component client SDK

Posted by Hari Shreedharan <hs...@cloudera.com>.
Yep, they are. I believe the reason that Log4jAppender#append is synchronized is because a bunch of the Avro Serialization code in populateAvroHeaders and serialize etc are not. 


Thanks,
Hari


On Tuesday, October 29, 2013 at 11:16 AM, Krishnan Nair.Praveen wrote:

> Hi,
>  
> I would like to know if  NettyAvroRpcClient methods are thread safe , so that same client instancecan be used by multiple threads 
> to post log events from a java application. 
>  
> Could you provide an example code snippet that mentions the usage of  NettyAvroRpcClient methods in multithreaded situation?
>  
> Also the append method in org.apache.flume.clients.log4jappender.Log4jAppender seems to be synchronised. 
> Does that create a bottleneck if Log4jAppender is used from application for appending log messages to Flume?
>  
> Thanks & Regards,
> Praveen
>  
> 
> 
>