admin 管理员组

文章数量: 1184232


2024年2月29日发(作者:k8s是微服务架构吗)

代码如下:@Configuration@EnableBinding({})public class MQConfig {}5.5 添加发送消息的类

代码如下:5.8 测试消息的发送

5.9 启动类代码如下:

代码如下:@Configuration@EnableBinding({})public classMQConfig {}6.7 启动类@SpringBootApplication@EnableSchedulingpublic classRocketMQConsumerApplication { public static void main(String[] args) { ( ,args) ; }}七、测试案例测试7.1 启动服务启动 2 个服务:rocketmq-produce-examplerocketmq-consumer-example7.2 发送消息测试7.2.1 发送简单的字符串

localhost:28081/send/simple?msg=RocketMQ7.2.2 发送带标签的消息7.2.3 发送对象消息localhost:28081/send/object?id=1&userName=bjsxt&password=123456&tags=xxx7.2.4 发送事务消息localhost:28081/send/transaction?msg=order&num=1

localhost:28081/send/transaction?msg=order&num=2localhost:28081/send/transaction?msg=order&num=3


本文标签: 发送 消息 测试 启动 服务