rabbitmq 報錯:無隊列 springboot rabbitmq 三種創建隊列的方式

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章