因爲報錯 #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);
}
}