槽卡夫卡水槽从内存通道传递uuid

时间:2018-11-04 18:58:07

标签: flume kafka-producer-api flume-ng

我有一个水槽配置,试图拖尾日志->生成UUID->发布到kafka主题。

源是执行程序 通道就是记忆 正在使用UUID拦截器。 卡夫卡水槽。

UUID没有在标头中传递任何想法,为什么我该如何将UUID作为Kafka Sink的密钥传递。

a1.sources = r1
a1.sinks = k1
a1.channels = c1
a1.sources.r1.type = exec
a1.sources.r1.command = tail -f /usr/app1/log/app.log
a1.sources.r1.channels = c1
a1.sources.r1.interceptors = i1

# channel configuration
# Each channel's type must be defined.
a1.channels.c1.type = memory
a1.channels.c1.capacity = 100
a1.channels.c1.transactionCapacity = 100

# interceptor
a1.sources.r1.interceptors.i1.type = 
org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder
a1.sources.r1.interceptors.i1.headerName = id
a1.sources.r1.interceptors.i1.preserveExisting = true
a1.sources.r1.interceptors.i1.prefix = "flume_"

# Each sink's type must be defined
a1.sinks.k1.channel = c1
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.kafka.topic = testtopic
a1.sinks.k1.kafka.bootstrap.servers = localhost:<port>
a1.sinks.k1.kafka.flumeBatchSize = 20

0 个答案:

没有答案