[rabbitmq-discuss] no connection established

Geoffrey Anderson mrcoder at yahoo.com
Tue May 13 20:16:05 BST 2008

--- Ben Hood <0x6e6562 at gmail.com> wrote:

> Hi Geoffrey,
> Sorry to hear that you have run into difficulties.
> On 13 May 2008, at 17:53, Geoffrey Anderson wrote:
> > The rabbitmq server runs, it seems, but no connections are being  
> > accepted by it,
> > from the java samples or dotnet sample programs or my own programs.
> Can you try with a simple TCP client, e.g.
> nc 5672
> ?
> What shows up in the server log when you do this?

'nc' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\ga>telnet 5672
Connecting To not open connection to the host, on port 5672: Connect

Thank you for the interesting suggestion.  I imagine telnet is just as good as 'nc'
for this purpose although I don't know what 'nc' is.

Seems like no process is listening on port 5672 doesn't it?

OTOH netstat suggests there really IS a process listening there, if I am reading it

C:\Documents and Settings\ga>netstat -a

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    alpeduez:epmap         alpeduez:0             LISTENING
  TCP    alpeduez:microsoft-ds  alpeduez:0             LISTENING
  TCP    alpeduez:1227          alpeduez:0             LISTENING
  TCP    alpeduez:4369          alpeduez:0             LISTENING
  TCP    alpeduez:5672          alpeduez:0             LISTENING
  TCP    alpeduez:1229          localhost:4369         ESTABLISHED
  TCP    alpeduez:4369          localhost:1229         ESTABLISHED

> > For three days I have been trying everything imaginable to me to get  
> > any client
> > program to connect to the rabbitmq server.  For example I disabled  
> > tcpv6 on my
> > system and tried all manner of user permissions in the rabbitmq  
> > server for 'guest'
> > and my custom account 'ga' which I gave all same permissions as  
> > 'guest'.
> >
> By default Rabbit ships with the user/pass combination guest/guest, so  
> without further ado that should work.

I agree.  Unfortunately guest/guest really does not work at the moment if the sample
programs are an indication.  I shall remove the guest account's permissions for host
security purposes later after this problem is resoloved.  Default accounts that ship
with server programs are typical attack targets for malware and script kiddies.

> > The web site asks users to send a note to legitimateconcern at rabbitmq.com 
> >  if it takes
> > more than 2 minutes to connect.  Si I have sent a detailed note.   
> > There has been no
> > response to it.
> Don't want to split hairs but the address is legitimategrievance at rabbitmq.com 
> , so you probably sent a message to a non-existent mailbox.

What I didn't tell you until now -- your answer is actually reasonable given what
you knew -- was that I pulled that email address from (human) memory as I was
writing, really only meant as an approximation to get the idea across of what I had
done.  It's not the email address I really used, which was copied from the web page
at rabbitmq.com into the clipboard memory and then pasted into the mail program
verbatim.  And lo, just a few minutes ago, another person has confirmed receipt of
the original email message, so it's known to be the correct address which I had used
the other day.

> >
> >
> > The web site says  Please join our mailing list or send questions to
> > info at rabbitmq.com. We'd love to hear from you.   I've subscribed and  
> > sent a detailed
> > message to the mailing list.  My email did not appear in the mailing  
> > list, and no
> > responses came back.
> Here's one :-)

Very much appreciated.

> > C:\rabbitmq\rabbitmq-dotnet-1.2.8025.1832- 
> > net-2.0\bin>DeclareQueue.exe alpeduez
> > testqueue
> > None of the specified endpoints were reachable
> > Endpoints attempted:
> >  endpoint=amqp-0-9://alpeduez:5672, attempts=1, outcome=AMQP server  
> > protocol
> > negotiation failure: server version 0-8, t
> > ransport parameters -1:-1
> > Stack trace:
> >   at RabbitMQ.Client.ConnectionFactory.CreateConnection(Int32  
> > maxRedirects,
> > AmqpTcpEndpoint[] endpoints)
> >   at  
> > RabbitMQ.Client.ConnectionFactory.CreateConnection(AmqpTcpEndpoint[]
> > endpoints)
> >   at RabbitMQ.Client.ConnectionFactory.CreateConnection(String  
> > address)
> >   at RabbitMQ.Client.Examples.DeclareQueue.Main(String[] args)
> >
> You need to specify the protocol version in your config file (refer to  
> the .NET client manual).
> This client is defaulting to AMQP 0-9 whereas Rabbit currently speaks  
> 0-8.

Your idea is intriguing... I have a good expectation about it.

You may well be correct.  It's interesting though, that the .Net client would be
defaulting to a version of the protocol which is more advanced than the RabbitMQ
server.  I wonder how the author developed the .Net client libs in advance of the
server.  He's a pretty advanced developer. ;)  

More specifically, in my own programs, I had been trying to use a construct like

IProtocol protocol = Protocols.FromEnvironment();
IConnection conn = factory.CreateConnection(protocol, hostName);

To my surprise it didn't work.  Now, I am looking at the .NET client user guide
sections 2.2 and 2.3.

It says there is (or expected to be) an environment variable where it gets its

"If no argument is passed to FromEnvironment() or FromConfiguration(), the value of
Protocols.DefaultAppSettingsKey is used. (At the time of writing, the default
appSettings key is
AMQP_PROTOCOL, the same as the name of the shell environment variable scanned.)"

Well the reality is that my system is telling me there really isn't any such shell
environment variable defined:  

C:\rabbitmq\librabbitmq-java-1.3.0>echo %AMQP_PROTOCOL%

Maybe this missing envoronment variable is why Protocols.FromEnvironment() is not
useful on my system.

Tyring to follow along with your suggestion, I guess there are two ways to get the
sample .NET programs working with the 0.8 protocol rather than 0.9 protocol.

1 - Change the environment variable AMQP_PROTOCOL.  However, my system is reporting
that I don't have this environment variable defined anywhere, so I don't know for
sure what to do.  Should I define one now?  I guess I could try to create one and
see what happens.  I guess I will set AMQP_PROTOCOL to the value "AMQP_0_8".

2 - Change the .config file for every client application. Seeing as they don't have
config files out of the box, I would need to create config files for each one I

3 - If I am programming my own code, rather than working with the sample programs, I
could also specify my client to use just the desired protocol in a line of code like
this, per User Guide section 2.2:

Given the following App.config snippet,

  <add key="my-protocol" value="AMQP_0_8"/>

the following code will also bind p to the 0-8 IProtocol implementation:

ConnectionFactory factory = new ConnectionFactory();
//IProtocol protocol = Protocols.FromEnvironment();
IProtocol p = Protocols.FromConfiguration("my-protocol");
IConnection conn = factory.CreateConnection(p, hostName);

Hopefully my own code will run if I write something like the above.  And I can try
to get the sample programs working later if I have time.

I guess I would ask you to cut to the chase if that's OK.  What did you or other
people actually do specifically on your own systems to get the .NET sample programs
working?   Did you manually create the environment variable AMQP_PROTOCOL and set it
to the value "AMQP_0_8"?

> >
> > 4.  Go look again to see if Tracer saw any traffic:
> >
> > C:\rabbitmq\librabbitmq-java-1.3.0>runjava.bat  
> > com.rabbitmq.tools.Tracer
> > Usage: Tracer [<listenport> [<connecthost> [<connectport>]]]
> > Invoked as: Tracer 5673 localhost 5672
> > com.rabbitmq.tools.Tracer.WITHHOLD_INBOUND_HEARTBEATS = false
> > com.rabbitmq.tools.Tracer.WITHHOLD_OUTBOUND_HEARTBEATS = false
> > com.rabbitmq.tools.Tracer.NO_ASSEMBLE_FRAMES = false
> > com.rabbitmq.tools.Tracer.NO_DECODE_FRAMES = false
> >
> >
> > It seems no traffic was detected during the dotnet sample program  
> > execution.
> >
> Your client will need to connect to the listen port of the tracer,  
> i.e. 5673. By default AMQP clients connect to 5672.
> HTH,
> Ben

OK that makes some sense.  Tracer is a simple proxy server then.

Thank you for the insightful responses.


More information about the rabbitmq-discuss mailing list