http://blog.csdn.net/derekjiang/article/details/9053863 分布式發布訂閱消息系統 Kafka 架構設計 - 目前見到的最好的Kafka中文文章
- Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
- // 設置每個topic開幾個線程
- topicCountMap.put(KafkaProperties.TOPIC, threadPerTopic);
- // 獲取stream
- Map<String, List<KafkaStream<byte[], byte[]>>> streams = connector.createMessageStreams(topicCountMap);