spring rabbit 发送消息是否需要声明队列

spring rabbit is it required to declare queue for send a message

我需要将消息发送到名为 "myQueue" 的队列到 MQ 服务器。我是否应该在 spring 中声明所有必需的 bean,例如 Queue 等。在我看来没用,因为我只需要发送到服务器,如果可能的话接收,我不会去监听队列,是否可以把它扔在那里然后忘记,没有任何明确的配置?

I need to send a message to a queue with name "myQueue" to the MQ server. 
Should I declare all required beans in spring, like Queue and etc for it.

没有。如果没有声明连接工厂、交换和队列等 bean,您就无法将消息发布到队列。

It seems to me useless because I only need to send to server, and receive if possible, 
I`m not going to listen the queue, is it possible just to throw it there and forget, without any explicit configuration?

Spring 不是超自然的,尽管如果你想将消息推送到队列,你是否使用你的消息 spring 应该知道连接和队列详细信息。

关于spring-rabbit编程的更多细节,您可以参考my blog post