Kafka學習資料html
http://blog.csdn.net/bluetom520/article/details/54892959
https://www.infoworld.com/article/3215165/application-development/how-to-use-apache-kafka-messaging-in-net.html
https://github.com/Microsoft/CSharpClient-for-Kafka
https://github.com/Jroland/kafka-net
https://github.com/confluentinc/confluent-kafka-dotnet/issues/50
--kafka.net
http://blog.csdn.net/wulex/article/details/51786328
http://bbs.csdn.net/topics/392068221?page=1
--confluent.kafka
官網: https://www.confluent.io/product/compare/
https://github.com/confluentinc/confluent-kafka-dotnet
Kafka生產者Producer配置
http://blog.51cto.com/favccxx/1767882
注意:
1、
使用Kafka,須要配置hosts文件,hosts地址:C:\Windows\System32\drivers\etc 。配置方式以下:
1. 在搜索程序和文件中,輸入cmd,點擊cmd.exe,右鍵以管理員身份打開。
二、在控制檯中輸入notepad,打開文本文檔
三、在文本文檔中選擇「打開」,找到hosts文件打開
四、在host文件中配置kafka ip及域名對應關係。保存。
(
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
ip地址 along (域名)
)
2、Kafka中key的做用
key是用於hash分區的。通常咱們創建kafka topic的時候,能夠預分區。好比分了8個區。
這樣你在往kafka寫入的時候,若是key是a開頭,就存到了分區1,b開頭就存到了分區2,以此類推。固然內部確定是挺複雜的,
分區多了,能夠多線程併發讀取數據,不然1個分區,讀取速度和寫入速度都很慢。
不傳key就隨機放一個地方了。可是不建議這樣作。這樣作就消息就沒有順序了。
固然,存入分區以前,最好使用md5一次。避免設備都跑到一個分區了。
String did = "homer xxxxx";
send( md5(did) , value );
分區是一個區域,沒有數量之說。
你這樣想,若是全部消息,全都放在一個盒子裏面,當你消費的時候,也只能一個線程消費。這樣速度慢。
若是topic有8個分區,就是有8個盒子,這樣能夠開8個線程消費。
至於一個盒子,能存多少數據,這個是無限的,取決於服務器配置
key只是用做,kafka用來判斷,這個消息放到哪一個盒子中。