Spring Cloud Stream integrates Rocketmq
First you need to introduce the dependency package
The project uses gradle to build dependency packages as follows:
//spring cloud stream
compile('com.alibaba.cloud:spring-cloud-starter-stream-rocketmq:2.2.1.RELEASE')
application.properties configuration is as follows
#rocketmq服务地址,集群多台用';'分隔
spring.cloud.stream.rocketmq.binder.name-server=127.0.0.1:9876
#生产者
#指定生产者发送的topic名称
spring.cloud.stream.bindings.ccAdminServiceMessageOut.destination=comment-topic-comment-insert
#指定编码类型
spring.cloud.stream.bindings.ccAdminServiceMessageOut.content-type=application/json
#消费者
#指定消费的topic名称
spring.cloud.stream.bindings.ccAdminServiceCommentIn.destination=comment-topic-comment-insert
#指定编码类型
spring.cloud.stream.bindings.ccAdminServiceCommentIn.content-type=application/json
#指定分组名称
spring.cloud.stream.bindings.ccAdminServiceCommentIn.group=cc-admin-comment-consumer-group
Where ccAdminServiceCommentIn and ccAdminServiceMessageOu