rabbitmq direct connection switch pit

RabbitMQ's directly connected switch cannot start sending commands first and then start receiving commands.

You must first turn on the receive command, let it sit there, and then start the send command, send one and receive one.

Because the directly connected switch must first specify the relationship between the switch and the queue, otherwise the message will be invalid.

In addition:
 rabbitmq web management interface  http://localhost:15672/

ADD:

Any message sent to direct exchange will be forwarded to the queue specified in routing_key
1. Generally, you can use the Exchange that comes with rabbitMQ: "" (the name of the exchange is an empty string)
2. In this mode, there is no need to Exchange performs any binding operation
3. A "routing_key" is required for message delivery, which can be simply understood as the queue name to be sent to.
4. If the queue name specified in routing_key does not exist in the vhost, the message will be discarded
in Demo . Although a band with exchange='yanfa' and queue='anheng' was declared,
the exchange and bind were not used when sending messages later. Instead, the
direct mode was used, without specifying exchange, and specifying routing_key. The name is the queue name, and
the message will be sent to the specified queue.
If an exchange is declared as direct and routing_key is specified in bind, then both the exchange and routing_key need to be specified when sending a message.
 

Supongo que te gusta

Origin blog.csdn.net/xyy_forever/article/details/81774271
Recomendado
Clasificación