title: RabbitMQ publish a message with REST API
body: <p>I have an application written in Python (PIKA) and C# (official NuGet package). Those applications are publishing new messages into RabbitMQ queues.</p>
  
  <p>Until now, I used this syntax to publish a new message into the queue:</p>
  
  <pre><code>model.BasicPublish(exchange, routingKey, basicProperties, body);
  </code></pre>
  
  <p>I found that <code>BasicPublish</code> function always returns with success. I also read in RabbitMQ documentation that in case of broker destroyed, the messages that didn't send yet will be removed without sending it to RabbitMQ. </p>
  
  <p>I want to avoid the loss of messages. So, I found 3 options to submit those messages to publish:</p>
  
  <ol>
  <li>Transaction - Very slow.</li>
  <li>Confirmation - I found it tricky to implement in a multi-threaded environment. </li>
  <li>with REST API - What do you think about that?</li>
  </ol>
  
  <p>I think that it will be ideal for me yo use REST API for inserting messages into queues. </p>
  
  <h2>The Question:</h2>
  
  <p>The way that I found to send a message with API is to send POST message to this endpoint:</p>
  
  <pre><code>http://localhost:15672/api/exchanges/vhost/amq.default/publish
  </code></pre>
  
  <p>As you can see, this port (15672) belongs to the RabbitMQ management system. </p>
  
  <ol>
  <li>Is this the right way to use RabbitMQ with REST API? </li>
  <li>Can I trust the RabbitMQ management system in the production environment?</li>
  <li>Can you recommend an alternative to REST API that will accept to message enqueue immediately after insertion (blocking)?</li>
  </ol>