EVEN DRIVEN - SPRING CLOUD STREAM - 從非SCS組件發送消息到SCS組件
在SPRING INTEGRATION中,如果要從非SPRING INTEGRATION代碼發送MESSAGE到SPRING INTEGRATION程序,通常用BUS GATEWAY。那么在SPRING CLOUD STREAM中,如果要從非SPRING CLOUD STREAM代碼發送MESSAGE到SPRING CLOUD STREAM程序,通常就要先通知框架自動生成一個SOURCE。
application.property
spring.cloud.stream.source=supplier
spring.cloud.stream.bindings.supplier-out-0.destination=notification-events
spring.cloud.stream.bindings.supplier-out-0.destination=notification-events
java
streamBridge.send("supplier-out-0", userDto);
Reference:
https://blog.devgenius.io/event-driven-microservices-with-spring-cloud-stream-e034eee3f394
posted on 2021-11-19 11:47 paulwong 閱讀(256) 評論(0) 編輯 收藏 所屬分類: SPRING CLOUD 、EVEN DRIVEN ARCHITECT