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();
}
具体封装自己整就行