You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by m4tthall <m4...@outlook.com> on 2014/01/22 11:55:28 UTC

Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

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?

Here is a snippet of the code in case that provides any clues

String host = "localhost:5672";
String addr = "amq.direct/key";
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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Chuck Rolke <cr...@redhat.com>.
Check out the build procedures at http://people.apache.org/~chug/proton-win/

The drill is to build proton first and install it. The procedure uses drive P:
at the root of the proton checkout and installs proton at P:\install.

Then build qpid with "-DPROTON_ROOT=P:/install" in CMake so that 
Qpid includes Proton.

-Chuck


----- Original Message -----
> From: "m4tthall" <m4...@outlook.com>
> To: users@qpid.apache.org
> Sent: Friday, January 24, 2014 8:40:32 AM
> Subject: Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0
> 
> Chuck Rolke wrote
> > Sorry for the goose chase about grepping for symbols.
> > 
> > Amqp1.0 support is supplied by library qpid-proton.dll.
> > This is a dependent of qpidmessaging.dll.
> > If qpid-proton.dll is a dependent and your executable refuses to run
> > without it
> > then amqp1.0 support is enabled.
> > 
> >   X:\>dumpbin /dependents qpidmessagingd.dll
> >   Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
> >   Copyright (C) Microsoft Corporation.  All rights reserved.
> > 
> >   Dump of file qpidmessagingd.dll
> > 
> >   File Type: DLL
> > 
> >    Image has the following dependencies:
> > 
> >     KERNEL32.dll
> >     qpidtypesd.dll
> >     qpidclientd.dll
> >     qpidcommond.dll
> >     qpid-protond.dll
> >     MSVCP90D.dll
> >     MSVCR90D.dll
> >     boost_thread-vc90-mt-gd-1_47.dll
> >     boost_date_time-vc90-mt-gd-1_47.dll
> 
> No worries.
> 
> OK, so mine is showing
> 
>   Image has the following dependencies:
> 
>     KERNEL32.dll
>     qpidtypes.dll
>     qpidclient.dll
>     qpidcommon.dll
>     MSVCP100.dll
>     boost_thread-vc100-mt-1_47.dll
>     MSVCR100.dll
>     boost_program_options-vc100-mt-1_47.dll
> 
> I am guessing it wasn't built correctly then. Would you mind giving me the
> instructions so I can pass on to the people that did the build for me
> please? Or send me to a link?
> 
> Thanks
> 
> 
> 
> 
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603359.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
Chuck Rolke wrote
> Sorry for the goose chase about grepping for symbols.
> 
> Amqp1.0 support is supplied by library qpid-proton.dll. 
> This is a dependent of qpidmessaging.dll.
> If qpid-proton.dll is a dependent and your executable refuses to run
> without it
> then amqp1.0 support is enabled.
> 
>   X:\>dumpbin /dependents qpidmessagingd.dll
>   Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
>   Copyright (C) Microsoft Corporation.  All rights reserved.
> 
>   Dump of file qpidmessagingd.dll
> 
>   File Type: DLL
> 
>    Image has the following dependencies:
> 
>     KERNEL32.dll
>     qpidtypesd.dll
>     qpidclientd.dll
>     qpidcommond.dll
>     qpid-protond.dll
>     MSVCP90D.dll
>     MSVCR90D.dll
>     boost_thread-vc90-mt-gd-1_47.dll
>     boost_date_time-vc90-mt-gd-1_47.dll

No worries.

OK, so mine is showing

  Image has the following dependencies:

    KERNEL32.dll
    qpidtypes.dll
    qpidclient.dll
    qpidcommon.dll
    MSVCP100.dll
    boost_thread-vc100-mt-1_47.dll
    MSVCR100.dll
    boost_program_options-vc100-mt-1_47.dll

I am guessing it wasn't built correctly then. Would you mind giving me the
instructions so I can pass on to the people that did the build for me
please? Or send me to a link?

Thanks




--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603359.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Chuck Rolke <cr...@redhat.com>.
Sorry for the goose chase about grepping for symbols.

Amqp1.0 support is supplied by library qpid-proton.dll. 
This is a dependent of qpidmessaging.dll.
If qpid-proton.dll is a dependent and your executable refuses to run without it
then amqp1.0 support is enabled.

  X:\>dumpbin /dependents qpidmessagingd.dll
  Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
  Copyright (C) Microsoft Corporation.  All rights reserved.

  Dump of file qpidmessagingd.dll

  File Type: DLL

   Image has the following dependencies:

    KERNEL32.dll
    qpidtypesd.dll
    qpidclientd.dll
    qpidcommond.dll
    qpid-protond.dll
    MSVCP90D.dll
    MSVCR90D.dll
    boost_thread-vc90-mt-gd-1_47.dll
    boost_date_time-vc90-mt-gd-1_47.dll


----- Original Message -----
> From: "Gordon Sim" <gs...@redhat.com>
> To: users@qpid.apache.org
> Sent: Thursday, January 23, 2014 12:10:03 PM
> Subject: Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0
> 
> On 01/22/2014 05:14 PM, m4tthall wrote:
> > Chuck Rolke wrote
> >>  From a Visual Studio (version of which matches your build) command
> >>  prompt:
> >>
> >>> dumpbin /all qpidcommond.dll    | findstr /i charsequence
> >>> dumpbin /all qpidmessagingd.dll | findstr /i charsequence
> >>
> >> If any symbols are listed then amqp1.0 support is included.
> 
> These symbols would be in whether 1.0 support was enabled or not (though
> they are connected with 1.0, they are dependent on proton and are
> compiled into the qpidcommon library regardless).
> 
> A better symbol to search for might be AddressHelper in the
> qpidmessaging library.
> 
> >
> > So, the following snippet would indicate it is?
> >
> >    100B3E50: 71 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65
> > qp::CharSequence
> >    100B4C10: 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20
> >    p::CharSequence
> >    100B56F0: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26
> >    ::CharSequence
> > &
> >    100B5E30: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26
> >    ::CharSequence
> > &
> >    100DC220: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 31 32
> > UCharSequence@12
> >    100DF190: 3F 3F 42 43 68 61 72 53 65 71 75 65 6E 63 65 40
> > ??BCharSequence@
> >    100FC330: 40 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D
> > @CharSequence@am
> >    100FD610: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33
> > UCharSequence@23
> >    100FDFD0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> > CharSequence@23@
> >    100FE020: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> > CharSequence@23@
> >    100FE070: 49 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65
> > IABUCharSequence
> >    100FE2A0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> > CharSequence@23@
> >    100FE380: 58 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65
> > XABUCharSequence
> >    100FE3D0: 42 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32
> > BUCharSequence@2
> >    10104860: 41 45 58 55 43 68 61 72 53 65 71 75 65 6E 63 65
> > AEXUCharSequence
> >    1010AB50: 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D 71
> > CharSequence@amq
> >           37   24 0007DD50
> >           ??0Descriptor@amqp@qpid@@QAE@ABUCharSequence@12@@Z
> >
> > Thanks
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603111.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
> 
> 

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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
On 01/22/2014 05:14 PM, m4tthall wrote:
> Chuck Rolke wrote
>>  From a Visual Studio (version of which matches your build) command prompt:
>>
>>> dumpbin /all qpidcommond.dll    | findstr /i charsequence
>>> dumpbin /all qpidmessagingd.dll | findstr /i charsequence
>>
>> If any symbols are listed then amqp1.0 support is included.

These symbols would be in whether 1.0 support was enabled or not (though 
they are connected with 1.0, they are dependent on proton and are 
compiled into the qpidcommon library regardless).

A better symbol to search for might be AddressHelper in the 
qpidmessaging library.

>
> So, the following snippet would indicate it is?
>
>    100B3E50: 71 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65
> qp::CharSequence
>    100B4C10: 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20  p::CharSequence
>    100B56F0: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26  ::CharSequence
> &
>    100B5E30: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26  ::CharSequence
> &
>    100DC220: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 31 32
> UCharSequence@12
>    100DF190: 3F 3F 42 43 68 61 72 53 65 71 75 65 6E 63 65 40
> ??BCharSequence@
>    100FC330: 40 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D
> @CharSequence@am
>    100FD610: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33
> UCharSequence@23
>    100FDFD0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> CharSequence@23@
>    100FE020: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> CharSequence@23@
>    100FE070: 49 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65
> IABUCharSequence
>    100FE2A0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40
> CharSequence@23@
>    100FE380: 58 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65
> XABUCharSequence
>    100FE3D0: 42 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32
> BUCharSequence@2
>    10104860: 41 45 58 55 43 68 61 72 53 65 71 75 65 6E 63 65
> AEXUCharSequence
>    1010AB50: 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D 71
> CharSequence@amq
>           37   24 0007DD50 ??0Descriptor@amqp@qpid@@QAE@ABUCharSequence@12@@Z
>
> Thanks
>
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603111.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
So, assuming that dump means that AMQP 1.0 support is included, any thoughts
on what is going wrong?

Thanks,

Matt



--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603154.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
Chuck Rolke wrote
> From a Visual Studio (version of which matches your build) command prompt:
> 
>> dumpbin /all qpidcommond.dll    | findstr /i charsequence
>> dumpbin /all qpidmessagingd.dll | findstr /i charsequence
> 
> If any symbols are listed then amqp1.0 support is included.

So, the following snippet would indicate it is?

  100B3E50: 71 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 
qp::CharSequence
  100B4C10: 70 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20  p::CharSequence
  100B56F0: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26  ::CharSequence
&
  100B5E30: 3A 3A 43 68 61 72 53 65 71 75 65 6E 63 65 20 26  ::CharSequence
&
  100DC220: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 31 32 
UCharSequence@12
  100DF190: 3F 3F 42 43 68 61 72 53 65 71 75 65 6E 63 65 40 
??BCharSequence@
  100FC330: 40 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D 
@CharSequence@am
  100FD610: 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 
UCharSequence@23
  100FDFD0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40 
CharSequence@23@
  100FE020: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40 
CharSequence@23@
  100FE070: 49 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65 
IABUCharSequence
  100FE2A0: 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 33 40 
CharSequence@23@
  100FE380: 58 41 42 55 43 68 61 72 53 65 71 75 65 6E 63 65 
XABUCharSequence
  100FE3D0: 42 55 43 68 61 72 53 65 71 75 65 6E 63 65 40 32 
BUCharSequence@2
  10104860: 41 45 58 55 43 68 61 72 53 65 71 75 65 6E 63 65 
AEXUCharSequence
  1010AB50: 43 68 61 72 53 65 71 75 65 6E 63 65 40 61 6D 71 
CharSequence@amq
         37   24 0007DD50 ??0Descriptor@amqp@qpid@@QAE@ABUCharSequence@12@@Z

Thanks




--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603111.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Chuck Rolke <cr...@redhat.com>.
> 
> Are there some simple instructions somewhere that show what you need to do
> in order to make sure AMQP support is enabled? Is there an easy way to check
> that it has been enabled?
> 

You can check qpidcommon[d].dll or qpidmessaging[c].dll for the presence of CharSequence symbols.

>From a Visual Studio (version of which matches your build) command prompt:

> dumpbin /all qpidcommond.dll    | findstr /i charsequence
> dumpbin /all qpidmessagingd.dll | findstr /i charsequence

If any symbols are listed then amqp1.0 support is included.

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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
Gordon Sim wrote
> Is the AMQP 1.0 support enabled in your build? What version are you 
> using and did you have proton installed when building?

Someone else did the build for me, as I didn't have the necessary
dependencies and I am more of a .NET person. Looking at
org.apache.qpid.messaging.dll and qpidmessaging.dll properties it shows
0.27.0.1. 

Are there some simple instructions somewhere that show what you need to do
in order to make sure AMQP support is enabled? Is there an easy way to check
that it has been enabled?





--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603078.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
On 01/22/2014 11:59 AM, m4tthall wrote:
> Gordon Sim wrote
>> Sorry, it's a little more annoying than that. You have to specify the
>> option in a Dictionary passed to the constructor of the connection
>> (second parameter, after host/url). Unfortunately by the time you have
>> the connection object, it has currently already chosen the protocol to
>> use.
>
> Sorry, probably doing something stupid but I have changed to the following
>
> var connectionOptions = new Dictionary<string, object> { { "protocol",
> "amqp1.0" } };
> connection = new Connection(host, connectionOptions);
> connection.Open();
>
> But still get this error
>
> $exception	{"Invalid option: protocol not recognised
> (qpid\\client\\amqp0_10\\ConnectionImpl.cpp:166)"}	System.Exception
> {Org.Apache.Qpid.Messaging.QpidException}

Is the AMQP 1.0 support enabled in your build? What version are you 
using and did you have proton installed when building?


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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
Gordon Sim wrote
> Sorry, it's a little more annoying than that. You have to specify the 
> option in a Dictionary passed to the constructor of the connection 
> (second parameter, after host/url). Unfortunately by the time you have 
> the connection object, it has currently already chosen the protocol to
> use.

Sorry, probably doing something stupid but I have changed to the following

var connectionOptions = new Dictionary<string, object> { { "protocol",
"amqp1.0" } };
connection = new Connection(host, connectionOptions);
connection.Open();

But still get this error

$exception	{"Invalid option: protocol not recognised
(qpid\\client\\amqp0_10\\ConnectionImpl.cpp:166)"}	System.Exception
{Org.Apache.Qpid.Messaging.QpidException}





--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603073.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
On 01/22/2014 11:21 AM, m4tthall wrote:
> Gordon Sim wrote
>> Yes, at present you need to set the 'protocol' connection option to
>> 'amqp1.0'.
>>
>> 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'";
>
> Hi Gordon,
>
> Thanks for the response. I have just made the following changes:
>
> String addr = "'/exchanges/amq.direct/key'";
> connection.SetOption("protocol", "amqp1.0");

Sorry, it's a little more annoying than that. You have to specify the 
option in a Dictionary passed to the constructor of the connection 
(second parameter, after host/url). Unfortunately by the time you have 
the connection object, it has currently already chosen the protocol to use.


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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by m4tthall <m4...@outlook.com>.
Gordon Sim wrote
> Yes, at present you need to set the 'protocol' connection option to 
> 'amqp1.0'.
> 
> 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'";

Hi Gordon,

Thanks for the response. I have just made the following changes:

String addr = "'/exchanges/amq.direct/key'";
connection.SetOption("protocol", "amqp1.0");

However, I now get an exception on SetOption: 

_message = "Invalid option: protocol not recognised
(qpid\\client\\amqp0_10\\ConnectionImpl.cpp:166)"

I assume I have done something wrong?

Thanks again,

Matt



--
View this message in context: http://qpid.2158936.n2.nabble.com/Connecting-to-RabbitMQ-using-Qpid-Messaging-API-and-NET-using-AMQP-1-0-tp7603069p7603071.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


Re: Connecting to RabbitMQ using Qpid Messaging API and .NET using AMQP 1.0

Posted by Gordon Sim <gs...@redhat.com>.
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