Note that there are some explanatory texts on larger screens.

plurals
  1. PORabbitMQ HelloWorld messages being blocked on localhost?
    primarykey
    data
    text
    <p>I have been running the hello world RabbitMQ example with the code below:</p> <pre><code>import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.Connection; import com.rabbitmq.client.Channel; public class Send { private final static String QUEUE_NAME = "hello"; public static void main(String[] argv) throws java.io.IOException { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.queueDeclare(QUEUE_NAME, false, false, false, null); String message = "Hello World!"; channel.basicPublish("", QUEUE_NAME, null, message.getBytes()); System.out.println(" [x] Sent '" + message + "'"); channel.close(); connection.close(); } } </code></pre> <p>and:</p> <pre><code>import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.Connection; import com.rabbitmq.client.Channel; import com.rabbitmq.client.QueueingConsumer; public class Recv { private final static String QUEUE_NAME = "hello"; public static void main(String[] argv) throws java.io.IOException, java.lang.InterruptedException { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("localhost"); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.queueDeclare(QUEUE_NAME, false, false, false, null); System.out.println(" [*] Waiting for messages. To exit press CTRL+C"); QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume(QUEUE_NAME, true, consumer); while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(); String message = new String(delivery.getBody()); System.out.println(" [x] Received '" + message + "'"); } } } </code></pre> <p>When I run the receiver it listens to the queue, and the sender says its sending the message but doesn't seem to close. I then run:</p> <pre><code>rabbitmqctl list_queues </code></pre> <p>The queue is definitely being created.</p> <p>However when I run:</p> <pre><code>rabbitmqctl list_connections </code></pre> <p>I get the following output </p> <pre><code>benuni@DeShawn:~$ sudo rabbitmqctl list_connections ls: cannot access /etc/rabbitmq/rabbitmq.conf.d: No such file or directory Listing connections ... guest 127.0.0.1 64700 blocked guest 127.0.0.1 64709 blocked guest 127.0.0.1 64614 blocked guest 127.0.0.1 64716 blocked guest 127.0.0.1 64717 blocked guest 127.0.0.1 64701 blocked guest 127.0.0.1 64699 blocking guest 127.0.0.1 64613 blocking guest 127.0.0.1 64708 blocking guest 127.0.0.1 64718 blocked guest 127.0.0.1 64706 blocked ...done. </code></pre> <p>SO for some reason the rabbitmq server is blocking my connections? Does anyone know what i need to do? Thanks, Ben</p>
    singulars
    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