qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0
Date Wed, 22 Jan 2014 11:06:35 GMT
On 01/22/2014 10:55 AM, m4tthall wrote:
> Hi,
>
> So I am pretty new to all this but this is what I have done so far:
>
> * Installed the AMQP 1.0 plugin on RabbitMQ
> * Got someone else to build me org.apache.qpid.messaging.dll
> * Created a test client in .NET that attempts to send a message to RabbitMQ
> using the org.apache.qpid.messaging reference
>
> The results are:
>
> * App hangs (as in sits there doing nothing) on connection.Open()
> * RabbitMQ log shows the following corresponding entries
>
> accepting AMQP connection <0.1096.0> ([::1]:62242 -> [::1]:5672)
> closing AMQP connection <0.1096.0> ([::1]:62242 -> [::1]:5672):
> {bad_version,{1,1,0,10}}
>
> I have spent a fair bit of time trying to investigate this and the only
> thing I can find is that bad_version might be due to using AMQP 0-10 rather
> than AMQP 1.0 as RabbitMQ only supports 0-9-1 or 1.0 via the plugin.
>
> So, I have a couple of questions:
>
> * Have I setup something incorrectly?
> * Do I need to specify something on the Qpid client to force it to use AMQP
> 1.0?

Yes, at present you need to set the 'protocol' connection option to 
'amqp1.0'.

Having the client try all supported protocols when this option is not 
specified (until the broker accepts one), would be a nice addition I 
guess, I just haven't got round to doing it.

> Here is a snippet of the code in case that provides any clues
>
> String host = "localhost:5672";
> String addr = "amq.direct/key";

You will also need to change this address a little when running against 
RabbitMQ as it doesn't support the 'legacy bindings' filters.


   String addr = "'/exchanges/amq.direct/key'";

should do what you want however.


> Int32 nMsg = 10;
>
> Console.WriteLine("csharp.direct.sender");
> Console.WriteLine("host : {0}", host);
> Console.WriteLine("addr : {0}", addr);
> Console.WriteLine("nMsg : {0}", nMsg);
> Console.WriteLine();
>
> Connection connection = null;
> try
> {
>     connection = new Connection(host);
>     connection.Open(); <--- FAILS HERE, NO EXCEPTION BEING CAUGHT
>     if (!connection.IsOpen) {
>        Console.WriteLine("Failed to open connection to host : {0}", host);
>     } else {
>        Session session = connection.CreateSession();
>        Sender sender = session.CreateSender(addr);
>        for (int i = 0; i < nMsg; i++) {
>           Message message = new Message(String.Format("Test Message {0}",
> i));
>           sender.Send(message);
>        }
>        session.Sync();
>        connection.Close();
>        return;
>     }
> } catch (Exception e) {
>     Console.WriteLine("Exception {0}.", e);
>     if (null != connection)
>        connection.Close();
> }
>
> Thanks in advance for any help
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message