0
点赞
收藏
分享

微信扫一扫

rabbitmq 报错:无队列 springboot rabbitmq 三种创建队列的方式

海滨公园 2022-04-22 阅读 77
java后端

因为报错#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue ‘helloTest’ in vhost ‘/’, class-id=50, method-id=10

生产者:如下

package com.example.consulServerOne.consulServerOneController;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
* @title 一句话说明功能
* @author: wangtingsong
* @Date: 2020/6/15 14:38
* @since 版本号
*/

@Component
public class HelloRabbitPro {

@Autowired
private AmqpTemplate amqpTemplate;

public void test(String str){

amqpTemplate.convertAndSend("helloTest",str);
}
}
举报

相关推荐

0 条评论