类加载运行全过程
当我们用java命令运行某个类的main函数启动程序时,首先需要通过类加载器把主类加载到JVM。
public class Math {public static final int initData 666;public static User user new User();public int compute() { //一个方法对应一块栈帧内…
文章目录 一、代码1、添加依赖2、配置kafka3、创建生产者4、创建消费者5、测试 二、遇到问题1、could not be established. Broker may not be available2、Error while fetching metadata with correlation id xxx 一、代码
1、添加依赖
在pom.xml文件中添加Kafka的依赖
&l…