– Start
点击此处观看本系列配套视频
废话少说,直接上代码。
package shangbo.kafka.example10;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class App {
@SuppressWarnings({ "resource", "unused" })
public static void main(String[] args) throws InterruptedException {
ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
}
}
package shangbo.kafka.example10;
import java.util.HashMap;
import java.util.Map;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.k