Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have identified the issue myself after some frustrating hours. Overall, let me confess to be upset with the vague tutorias and documentation about RabbitMQ.... Anyways, here is what the problem was:</p> <p>1) Queue Names are supposed to be in binary form, therefore preceded by "&lt;&lt;" and superceded by ">>". For example : &lt;&lt;"my queue name">> ( quotes included as well ) </p> <p>2) In a different scenario where I was trying to create the queue with <strong>queue.declare</strong>, the fact that the queue already existed was not a problem, but the fact that the queue was durable and the <strong>queue.declare</strong> did not specify that set of parameters caused the program to throw an error and interrupt execution. This is an unfortunate behavior where normally, developers would expect the queue matching to be done simply by name and then proceed. So to fix that I had to specify the <strong>durable</strong> value.</p> <p>Here is a simple working code:</p> <pre><code>-module(test). -export([test/0]). -include_lib("amqp_client/include/amqp_client.hrl"). test() -&gt; {ok, Connection} = amqp_connection:start(#amqp_params_network{}), {ok, Channel} = amqp_connection:open_channel(Connection), Declare = #'queue.declare'{queue = &lt;&lt;"TEST_DIRECT_QUEUE"&gt;&gt;, durable = true}, #'queue.declare_ok'{} = amqp_channel:call(Channel, Declare), Get = #'basic.get'{queue = &lt;&lt;"TEST_DIRECT_QUEUE"&gt;&gt;, no_ack = true}, {#'basic.get_ok'{}, Content} = amqp_channel:call(Channel, Get), #amqp_msg{payload = Payload} = Content. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload