SpringCloud消息驱动Stream实例
依赖
1 | <dependencies> |
配置yml
1 | spring: |
配置properties
1 | # port |
广播
发送消息服务类
1 | import com.folkspace.base.config.RepOutput; |
MarketNftMessage
1 | import com.folkspace.base.message.BaseMessage; |
RepOutput
1 | import org.springframework.cloud.stream.annotation.Output; |
BaseMessage
1 | import com.alibaba.fastjson.JSON; |
接收消息服务类
1 |
|
RepInput
1 | import org.springframework.cloud.stream.annotation.Input; |
单播
发送消息服务类
1 | import com.folkspace.order.api.constants.OrderConstants; |
OrderMessage
1 | import com.folkspace.base.message.BaseMessage; |
BaseMessage
1 | import com.alibaba.fastjson.JSON; |
接收消息服务类
1 | import com.alibaba.fastjson.JSON; |