简单直接spring boot 集成 flume

pom依赖
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-ng-sdk</artifactId>
<version>1.8.0</version>
</dependency>

demo
public static void main(String [] args) throws EventDeliveryException {
String ip ="XX.XX.XX.X";
int port = 44446;

RpcClient client = RpcClientFactory.getDefaultInstance(ip, port);
Event event = EventBuilder.withBody("hello word", Charset.forName("UTF-8"));
client.append(event);
client.close();
}
具体封装自己整就行
posted @ 2018-11-19 11:11  简单的深度  阅读(3279)  评论(0编辑  收藏  举报