RabbitMQ C# hello world doesn't work, can't change port.

2,470 views
Skip to first unread message

grimmriffer

unread,
Dec 14, 2016, 7:46:50 AM12/14/16
to rabbitmq-users

I get a BrokerUnreachableException.
Within that is a ConnectionFailureException, with text {"No connection could be made because the target machine actively refused it 127.0.0.1:5672"}.

Changing the port in the file %appdata%\rabbitmq\rabbitmq.config so the file looks like this:
[
    {rabbit, [{tcp_listeners, [61616]}]}
].

...makes no change to the exception.  So, it's not changing the port.

Adding an environment variable:
RABBITMQ_NODE_PORT = 61616

...makes no change to the exception.  So, that's not changing the port either.
Not a particularly auspicious start to using a new technology.

My IT dept have been asked to help with enabling the port in case that would help, but in the meantime any ideas would be very very welcome.

Cheers!

Michael Klishin

unread,
Dec 14, 2016, 7:51:10 AM12/14/16
to rabbitm...@googlegroups.com
Tutorials assume RabbitMQ runs with all defaults, so AMQP listener uses port 5672.
If you change the port you must change tutorial code to use that port.
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ


grimmriffer

unread,
Dec 14, 2016, 8:02:31 AM12/14/16
to rabbitmq-users
How?

Ta.

grimmriffer

unread,
Dec 14, 2016, 9:08:28 AM12/14/16
to rabbitmq-users
OK, I've pointed it at two different ports in config file and code, no difference other than the port number in the exception.

I was really hoping to show that we should use rabbit here, In the dim distant past I've successfully got it up and running in minutes - I feel profoundly embarrassed and betrayed that it just barfs at step 1 now!  >:-(

Michael Klishin

unread,
Dec 14, 2016, 9:28:22 AM12/14/16
to rabbitm...@googlegroups.com
Is RabbitMQ running on 127.0.0.1 or a remote machine? Have you checked
server logs? Listeners log when they start, e.g.

```
=INFO REPORT==== 14-Dec-2016::17:25:41 ===
started TCP Listener on [::]:5672

=INFO REPORT==== 14-Dec-2016::17:25:41 ===
started SSL Listener on [::]:5671
```

This is network connectivity 101: find out what address RabbitMQ is reachable at (it bindings to all interfaces by default)
and on what port, then try connecting with telnet from the machine your client is on, then configure the client or find
out what blocks inbound TCP connections (e.g. a firewall).

Also, if this is a demo then why do you need to alter the ports at all?

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

grimmriffer

unread,
Dec 14, 2016, 10:24:13 AM12/14/16
to rabbitmq-users

I don't want to alter the ports, but a bit of googling suggested that doing so was the first port (gah!) of call for the error I am getting.  A red herring, maybe.  I just want to paste the example code from the site and go.

I'm afraid I never took network connectivity 101, but I feel the issue here is the random rotten spaghetti that is a corporate IT network rather than Rabbit itself.  That said I just got an MSMQ example running from scratch in literally less than a minute. 

This is polar opposite outcome of what happened the last time I grabbed these two libraries for a showdown!  I really don't know how the various Mordacs do what they do.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Dec 14, 2016, 10:34:49 AM12/14/16
to rabbitm...@googlegroups.com
You don't need to configure anything if this is a demo 
and your client runs on the same machine. That's the setup all tutorials on rabbitmq.com assume and use, for example.

I suspect that RabbitMQ wasn't running when you first tried.

grimmriffer

unread,
Dec 14, 2016, 4:49:34 PM12/14/16
to rabbitmq-users

Sorry if I'm not being clear, but the sample from tutorial 1 didn't work.  I tried it exactly as described with everything on one machine.  Only after that failed did I try to configure the ports.

Rabbit was always running.  The service has been restarted.  The machine has been restarted.

Michael Klishin

unread,
Dec 14, 2016, 5:53:21 PM12/14/16
to rabbitm...@googlegroups.com
What do

rabbitmqctl.bat status 
rabbitmqctl.bat environment 

output?

Honestly, I find it quite hard to believe that RabbitMQ is running with all defaults and tutorials cannot connect to it from localhost.

grimmriffer

unread,
Dec 16, 2016, 3:40:35 AM12/16/16
to rabbitmq-users
OK, I tried those commands and they both quite obviously blew up.
Before I thought to capture the output (sorry) I suddenly wondered if it was wrong to use the 64 bit version of erlang?
I uninstalled rabbit mq, uninstalled erlang, and started from scratch with the 32 bit erlang.
Now the rabbit service won't even start.
I uninstalled everything and installed both again, the service still won't start.
I repeated the 32 bit erlang install followed by rabbit mq on a different machine that has never had either installed on before
The service still won't start.
(Machine restarts were performed at all the obvious points.)

The error popup reads "Windows could not start the RabbitMQ service on local computer.  Error 1067: The process Terminated unexpectedly."

The erlang install used is as found here:

The rabbit install used is as found here:
https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6.exe

Machine 1 : Windows Server 2012 R2
Machine 2 : Windows 10 Pro

I've attached an erl_crash.dmp file from the appdata\rabbitmq folder.

I hope all this is of some use to you, not just a PITA distraction.

Cheers
erl_crash.dump

Michael Klishin

unread,
Dec 16, 2016, 5:46:50 AM12/16/16
to rabbitm...@googlegroups.com
So Erlang terminates on your machine. OK, that explains it.

The architecture you use must match your machine’s (which almost certainly is 64 bit).

The traces of Erlang VM termination can be difficult to find, see various Windows logs,
including firewall and other security tooling events.
> >> I don't *want *to alter the ports, but a bit of googling suggested that
Reply all
Reply to author
Forward
0 new messages