[rabbitmq-discuss] no connection established

Alexis Richardson alexis.richardson at cohesiveft.com
Thu May 15 15:02:21 BST 2008


Geoffrey

How are you getting on?  Have all your questions been answered
satisfactorily?  Let people know :-)

One thing - you asked about how we tested against different AMQP spec
versions.   To quote from http://www.rabbitmq.com/dotnet.html -

"The client library implements AMQP specifications version 0-8, 0-8bis
(0-8 as modified by QPid for their M2 release) and 0-9 (omitting
sections of the specification marked "work in progress", i.e. the
Message content-class). A single binary copy of the library contains
support for all three protocol variants, and code can select a variant
to use at runtime. The library has been tested against

    * RabbitMQ 1.2.x (AMQP 0-8)
    * QPid M2 (AMQP 0-8bis, 0-9 (in the M2.1 branch))
    * OpenAMQ 1.2c4 (AMQP 0-9)"

alexis





On Tue, May 13, 2008 at 8:16 PM, Geoffrey Anderson <mrcoder at yahoo.com> wrote:
>
> --- 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 0.0.0.0 5672
>>
>> ?
>>
>> What shows up in the server log when you do this?
>
>
> C:\rabbitmq\rabbitmq-dotnet-1.2.8025.1832-net-2.0\bin>nc
> 'nc' is not recognized as an internal or external command,
> operable program or batch file.
>
>
> C:\Documents and Settings\ga>telnet 0.0.0.0 5672
> Connecting To 0.0.0.0...Could not open connection to the host, on port 5672: Connect
> failed
>
> 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
> correctly:
>
> 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
> this:
>
> 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
> information:
>
> "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%
> %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
> guess.
>
> 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,
>
> <appSettings>
>  <add key="my-protocol" value="AMQP_0_8"/>
> </appSettings>
>
> 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.
>
> Geoffrey
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>



-- 
Alexis Richardson
+44 20 7617 7339 (UK)
+44 77 9865 2911 (cell)
+1 650 206 2517 (US)




More information about the rabbitmq-discuss mailing list