因为报错#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);
}
}