測試使用的消息為
\n====================================\n"+"[{\"item_id\":\"7341954\",\"title\":\"Apache Kafka系列(一) 起步\",\"url\":\"http://www.cnblogs.com/qizhelongdeyang/p/7341954.html\",\"context\":\"2tOkiKStM0d936gGWyt+3Kg/wultljgJzwyYI/fTjxzYYdFugMzRwERE/pAHGb7BJQ9TC3es1i+97zMRr3LODDEssye11NkrRqaah9MbR0dsQm7iQ6NdvWFNn4VKsUNutkSo0GJsWPnIEiVp40AeOHHE1WRtohIJI6thrfyEux8qnFihtMn6QcvRiApsXGZ3euU=\"},{\"item_id\":\"3859193\",\"title\":\"Kafka實戰(zhàn)系列--Kafka API使用體驗\",\"url\":\"http://www.cnblogs.com/mumuxinfei/p/3859193.html\",\"context\":\"WSyDGkDSIS3DDz4LS6U+L6aetxsRysTHCMzzf4jtiQgyC9XyLS75AGnOclEjaFldqoEhB1O5lVnn952YrHZrehO7Ypfva68hlv54j+9pu2EM8wBVk5KNsNnkKEBHZkp//29kLY6mA01FJXHpxyJR+SzIq31jewTUyMDrCw62DlSpqj61UA/T23PQF96WRHu6qEg=\"},{\"item_id\":\"10099894\",\"title\":\"kafka系列五掏颊、kafka常用java API\",\"url\":\"http://www.cnblogs.com/wangzhuxing/p/10099894.html\",\"context\":\"HtS99ktdfPbTsytlBvguGNHRkQnK1/lgGJN9l8OnLHO8htrF4XKD2gWPjHYpr4S0vwP+Jz/L+XbZ8fgcQ4zD+LI0CCfeMmGP4htnDocwq/mhGdLgl6X9++WvixS902RVv0n90wyKOnUQGCB0gBZtHHBzSfGD4QApwiE21KvXOQWeVtsQyfs9ldrtXkac4uwQ\"},{\"item_id\":\"9960093\",\"title\":\"Apache Kafka系列(七)Kafka Repartition操作\",\"url\":\"http://www.cnblogs.com/qizhelongdeyang/p/9960093.html\",\"context\":\"GM39c2pPiU3v85l5kGK5EVGLGHoUwAOM4BtiIVkvtJKnH3OlMOUBVEyAFRB3aGU7lPGTtBsiBte8Q8HdDeL0qf8Z6ilXa/ooVf1jirUO2mvHYL5flqkDDYIuxDkMZMuKUd/v+t4p4/FlNA0kSnXjSPffFI/v0zO1WBdu5aq+um8sTiDM\"},{\"item_id\":\"8579215\",\"title\":\"Kafka系列三 java API操作\",\"url\":\"http://www.cnblogs.com/zhaobingqing/p/8579215.html\",\"context\":\"bY8O7XljE8+UcSQ+11Tjio8kxVFRaLrYjjiYBcTR5HbqOgHQJVrVHd/haJ5BW6CtQJjE4CymNDtGSBiHj6fNgvuTmDwe0cWcme6Bfi2jEFt4fKq3FaSCTDJpuBiFzQ0Iamp/jWCd0v1Mla+Ep1EUmFCLNZGihz99YLYuMRRRP5Qm+Awr\"}]
test1
生產(chǎn)者發(fā)送六十萬,一個消費者烈涮,接收消息后寫入log4j本地磁盤适揉,結(jié)果如下(單位:ms)
日志文件為:
test2
經(jīng)過測試發(fā)現(xiàn)spring kafka中封裝的concurrency是指再實例上創(chuàng)建多少個consumer進行消費,對應(yīng)parttition的數(shù)量一致聪轿。
spring.kafka.listener.concurrency= 6