通过Flume发送XML文件(使用curl)

时间:2015-10-26 10:10:56

标签: xml http flume-ng

我使用Apache Flume移动数据,我已经设置了一个带有HTTP Source的代理。我希望这个源接收XML文件,这些文件最终将由一个接收器读取,这将推送到Cassandra(我自己的接收器)。所以我添加了一个HTTPSourceXMLHandler,以我想要的方式处理xml文件。 我有以下配置文件:

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = http
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
a1.sources.r1.handler = org.apache.flume.source.http.HTTPSourceXMLHandler

# Describe the sink
a1.sinks.k1.type = file_roll
a1.sinks.k1.sink.directory = /home/admin/Desktop/XMLs
a1.sinks.k1.rollInterval = 5 

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

我在localhost端口44444上有一个源,一个通道和一个文件接收器(现在,我只想要Flume接收器将xml保存在我的本地机器中进行性能测试)。 当我使用curl发送示例xml文件(ex.xml)时,操作成功,但是接收器不会将其保存为指定位置上的文件: curl -X POST -d @ex.xml http://localhost:44444

我做错了吗? XMLHandler运行良好并经过测试。 感谢。

0 个答案:

没有答案
相关问题