簡單直接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();
}
具體封裝自己整就行


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM