Browse Source

bean注入

develop
lau572 1 month ago
parent
commit
0bc9ac5954
  1. 2
      zc-business/src/main/java/com/zc/business/message/device/subscribe/KafkaTopicProducer.java

2
zc-business/src/main/java/com/zc/business/message/device/subscribe/KafkaTopicProducer.java

@ -5,6 +5,7 @@ import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
@ -14,6 +15,7 @@ import java.util.concurrent.ExecutionException;
*
*/
@Slf4j
@Configuration
public class KafkaTopicProducer {
@Value("${kafka.bootstrap-servers}")
private String servers;

Loading…
Cancel
Save