diff --git a/consumer/consumer-server/src/main/resources/application.yml b/consumer/consumer-server/src/main/resources/application.yml index 856bc8d..e4b7140 100644 --- a/consumer/consumer-server/src/main/resources/application.yml +++ b/consumer/consumer-server/src/main/resources/application.yml @@ -7,13 +7,16 @@ spring: cloud: stream: bindings: - sink1-in-0: + send1: destination: test2 - sink2-in-0: + send2: destination: test3 - function: - definition: sink1;sink2 - + function: + # 定义别名 + bindings: + sink1-in-0: send1 + sink2-in-0: send2 + definition: sink1;sink2 server: port: 8081 \ No newline at end of file diff --git a/producer/producer-server/src/main/java/top/fjy8018/producer/Producer.java b/producer/producer-server/src/main/java/top/fjy8018/producer/Producer.java index e760990..f8097e7 100644 --- a/producer/producer-server/src/main/java/top/fjy8018/producer/Producer.java +++ b/producer/producer-server/src/main/java/top/fjy8018/producer/Producer.java @@ -21,13 +21,13 @@ public class Producer { @RequestMapping("/send1") public String send1() { - streamBridge.send("source1-out-0", new Date()); + streamBridge.send("send1", new Date()); return "success1"; } @RequestMapping("/send2") public String send2() { - streamBridge.send("source2-out-0", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); + streamBridge.send("send2", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); return "success2"; } diff --git a/producer/producer-server/src/main/resources/application.yml b/producer/producer-server/src/main/resources/application.yml index b90191c..c30046e 100644 --- a/producer/producer-server/src/main/resources/application.yml +++ b/producer/producer-server/src/main/resources/application.yml @@ -7,12 +7,16 @@ spring: cloud: stream: bindings: - source1-out-0: + send1: destination: test2 - source2-out-0: + send2: destination: test3 - function: - definition: source1;source2 + function: + # 定义别名 + bindings: + source1-in-0: send1 + source2-in-0: send2 + definition: source1;source2 server: