1

I am trying to Hello World the rabbitmq-c implementation of AMQP.

I have a small script adopted from the example included with the rabbitmq-c source. Here's a snippet:

  socket = amqp_tcp_socket_new(conn);
  if (!socket) {
    die("creating TCP socket");
  }

  status = amqp_socket_open(socket, hostname, port);
  if (status) {
        die(amqp_error_string2(status));
  }
  printf ("Error opening socket: %s\n",strerror(errno));

If I run this on the same host as the rabbitmq server process (i.e., hostname is localhost), then the script connects and sends a message which is received by a listener. If I run this same program on a different box and supply the hostname of the box running Rabbit, then it dies when it tries to open the socket with a -9, which is just "a socket error occurred". "errno" is just the EINPROGRESS which is expected when I try to open a non-blocking socket. (It's the same error I see as when the program succeeds).

On failure, nothing shows up in the rabbitmq server log.

While I'd love it if someone could tell me specifically what's going wrong here, I'm really in need of a fishing pole. I have no idea how to get the information I need from the system here, not even really where to begin. I've never really done unix I/O before. Could anyone make some suggestions about debugging next steps?

masonk
  • 9,176
  • 2
  • 47
  • 58

1 Answers1

1

i can't really offer any direct advice on what to look for next... but from your description, it sounds like the machine that is hosting rabbitmq is not allowing the proper TCP/IP ports for communication.

i ran in to this when i installed RabbitMQ on RedHat Linux, a few months ago. I had to configure various security settings in the firewall and in the selinux security setup to allow the proper ports

Derick Bailey
  • 72,004
  • 22
  • 206
  • 219
  • A very promising avenue to look at. But how did you find that issue in the first place? Just intuition? – masonk Jul 30 '15 at 01:33
  • painful days of banging my head against similar problems when i installed on redhat linux. i found the log files for rabbitmq and they told me that they couldn't bind to the port, or somethign like that. i can't remember exactly, but the log files did tell me something. a lot of searching, trial and error eventually led me to SELinux settings – Derick Bailey Jul 30 '15 at 03:23
  • Since my RMQ is running on Red Hat, this is a pretty exciting hint. I'll check it out today. <3 – masonk Jul 30 '15 at 12:05