flume-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashutosh Panigrahi <apanigr...@sprinklr.com>
Subject Re: can anybody please tell me how to create custome interceptor
Date Thu, 13 Sep 2012 07:21:28 GMT

Your custom interceptor should implement the interface Interceptor , (org.apache.flume.interceptor.Interceptor)
and should write a builder implementing Interceptor.Builder

Put your logic inside the intercept method of the interface  (Populate some headers).

If you are modifying the existing source code then , Register your interceptor inside the
enum InterceptorType. ( I modify the flume source code itself , so has registered there).
e.g The entry for timestamp interceptor looks like this
                                 TIMESTAMP(org.apache.flume.interceptor.TimestampInterceptor.Builder.class)

If you are extending the flume source , then i feel giving the FQCN of the builder class in
the properties file should work. Never tested though. 


Regards
Ashutosh


On 13-Sep-2012, at 12:21 PM, Prajakta Bavikar <Prajakta_Bavikar@persistent.co.in> wrote:

> It will be very helpful if I get some sample for custom interceptor.
> Or some steps to follow..
>  
> -Prajakta
> DISCLAIMER ========== This e-mail may contain privileged and confidential information
which is the property of Persistent Systems Ltd. It is intended only for the use of the individual
or entity to which it is addressed. If you are not the intended recipient, you are not authorized
to read, retain, copy, print, distribute or use this message. If you have received this communication
in error, please notify the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.
> 


Mime
View raw message