🔄Update: 构建生产者和消费者骨架

This commit is contained in:
2025-10-14 23:02:41 +08:00
parent 1d4fa82fe7
commit e477ad36ba
6 changed files with 98 additions and 1 deletions
@@ -0,0 +1,28 @@
package cn.hezhaohui.rabbitmq;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class RabbitMQTest {
@Resource
private MessageProducer messageProducer;
@Test
public void testSendMessage() {
// TODO: 实现生产者发送消息的测试
// 1. 创建测试消息对象
// 2. 调用messageProducer.sendMessage()方法
// 3. 验证消息是否成功发送
}
@Test
public void testReceiveMessage() {
// TODO: 实现消费者接收消息的测试
// 1. 发送测试消息到队列
// 2. 等待消息被消费
// 3. 验证消息内容是否正确
}
}