定义别名

This commit is contained in:
2021-02-21 13:54:06 +08:00
parent b2ac356484
commit c707a6dedc
3 changed files with 18 additions and 11 deletions

View File

@@ -7,13 +7,16 @@ spring:
cloud:
stream:
bindings:
sink1-in-0:
send1:
destination: test2
sink2-in-0:
send2:
destination: test3
function:
# 定义别名
bindings:
sink1-in-0: send1
sink2-in-0: send2
definition: sink1;sink2
server:
port: 8081

View File

@@ -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";
}

View File

@@ -7,11 +7,15 @@ spring:
cloud:
stream:
bindings:
source1-out-0:
send1:
destination: test2
source2-out-0:
send2:
destination: test3
function:
# 定义别名
bindings:
source1-in-0: send1
source2-in-0: send2
definition: source1;source2