多主题配置

This commit is contained in:
2021-02-21 11:45:41 +08:00
parent 09d090a438
commit b2ac356484
4 changed files with 22 additions and 5 deletions

View File

@@ -5,6 +5,8 @@ import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
@@ -17,10 +19,16 @@ public class Producer {
@Autowired
private StreamBridge streamBridge;
@RequestMapping("/send")
public String send() {
@RequestMapping("/send1")
public String send1() {
streamBridge.send("source1-out-0", new Date());
return "success";
return "success1";
}
@RequestMapping("/send2")
public String send2() {
streamBridge.send("source2-out-0", LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME));
return "success2";
}
}

View File

@@ -9,8 +9,10 @@ spring:
bindings:
source1-out-0:
destination: test2
source2-out-0:
destination: test3
function:
definition: source1
definition: source1;source2
server: