The method PublishMessages is used to send a message to the AMQP server.
AMQP Servers automatically bind the queues to "direct" exchange using the queue name as routing key. This allows to send a message to a specific queue without the need to declare a binding (just calling PublishMessage method and pasing the Exchange argument as empty value and the name of the queue in the RoutingKey argument).
Publish Messages
The method has the following arguments:
- ChannelName: it's the name of the channel (must be open before call this method).
- ExchangeName: it's the name of the exchange, must be no longer of 255 characters and not begin with "amq." (except if passive parameter is true).
- RoutingKey: it's the binding's routing key name.
- Mandatory: if true and the message cannot be routed to any queue, the message is returned by the server, the event OnAMQPBasicReturn is fired.
- Immediate: if true and the message cannot be routed to any queue, the message is returned by the server, the event OnAMQPBasicReturn is fired.