feat():编辑卡夫卡代码
parent
5ab005839c
commit
af798f18e5
|
@ -4,9 +4,6 @@ import com.muyu.carData.listener.MyListener;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:张腾
|
* @Author:张腾
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.time.Duration;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
/**卡夫卡消费者
|
/**卡夫卡消费者
|
||||||
* @Author:张腾
|
* @Author:张腾臭狗熊
|
||||||
* @Package:com.muyu.carData.consumer
|
* @Package:com.muyu.carData.consumer
|
||||||
* @Project:cloud-server-8
|
* @Project:cloud-server-8
|
||||||
* @name:MyKafkaConsumer
|
* @name:MyKafkaConsumer
|
||||||
|
@ -29,7 +29,7 @@ public class MyKafkaConsumer implements InitializingBean {
|
||||||
@Autowired
|
@Autowired
|
||||||
private KafkaConsumer kafkaConsumer;
|
private KafkaConsumer kafkaConsumer;
|
||||||
|
|
||||||
private final String topicName = "test";
|
private final String topicName = "carJsons";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() throws Exception {
|
||||||
|
@ -51,5 +51,9 @@ public class MyKafkaConsumer implements InitializingBean {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
|
log.info("启动线程结束监听topic:{}",topicName);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue