mirror of
https://gitee.com/shikong-sk/springcloud-study
synced 2024-11-14 04:21:17 +08:00
调整
This commit is contained in:
parent
34b1d06ec5
commit
c2f6bac38d
@ -3,6 +3,7 @@ package cn.skcks.study.springcloud.kafka.producer.controller;
|
|||||||
import cn.skcks.study.springcloud.kafka.common.model.dto.Message;
|
import cn.skcks.study.springcloud.kafka.common.model.dto.Message;
|
||||||
import cn.skcks.study.springcloud.utils.JsonUtils;
|
import cn.skcks.study.springcloud.utils.JsonUtils;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.kafka.core.KafkaTemplate;
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -10,8 +11,8 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
public class SimpleController {
|
public class SimpleController {
|
||||||
@Autowired
|
|
||||||
private KafkaTemplate<Object, String> kafkaTemplate;
|
private KafkaTemplate<Object, String> kafkaTemplate;
|
||||||
final static String TOPIC_NAME = "test";
|
final static String TOPIC_NAME = "test";
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
kafka:
|
kafka:
|
||||||
# bootstrap-servers: 10.10.10.200:9092
|
bootstrap-servers: 10.10.10.200:9092
|
||||||
bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
|
# bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
|
||||||
|
|
||||||
producer:
|
producer:
|
||||||
retries: 1
|
retries: 1
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
spring:
|
spring:
|
||||||
kafka:
|
kafka:
|
||||||
# bootstrap-servers: 10.10.10.200:9092
|
bootstrap-servers: 10.10.10.200:9092
|
||||||
bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
|
# bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
|
||||||
|
|
||||||
producer:
|
producer:
|
||||||
retries: 1
|
retries: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user