java实现kafka生产消费模式,需要一些配置
学习记录使用
生产者:
public class classname{
public static final String TOPIC_NAME = "topic_name";
private static Properties props = new Properties();
static{
//kafka地址
props.put("bootstrap.servers", "ip:端口");
props.put("acks", "all");
props.put("retries", 0);
props.put("batch.size", size);
props.put("linger.ms", 1);
props.put