正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
@@ -42,7 +42,7 @@ public class ExSendMsg { | @@ -42,7 +42,7 @@ public class ExSendMsg { | ||
42 | Connection connection = ConnectionUtil.getConnection(hostIp,hostPort,vHostName,userName,password); | 42 | Connection connection = ConnectionUtil.getConnection(hostIp,hostPort,vHostName,userName,password); |
43 | // 从连接中创建通道 | 43 | // 从连接中创建通道 |
44 | Channel channel = connection.createChannel(); | 44 | Channel channel = connection.createChannel(); |
45 | - // 声明(创建)队列 | 45 | + // 声明(创建)交换 |
46 | channel.exchangeDeclare(exchangeName, exchangeType,true); | 46 | channel.exchangeDeclare(exchangeName, exchangeType,true); |
47 | // 消息内容 | 47 | // 消息内容 |
48 | channel.basicPublish(exchangeName, routingKey, null, msg.getBytes(StandardCharsets.UTF_8)); | 48 | channel.basicPublish(exchangeName, routingKey, null, msg.getBytes(StandardCharsets.UTF_8)); |
-
请 注册 或 登录 后发表评论