- Home /
Connecting to a Qpid Broker
I have a few questions about implementing AMQP in my Unity project. I'll start with the requirement, which is that our Unity app must connect to a C++ Qpid broker using the "--auth no" command line argument. Also, the Unity version is 2017.1 using .NET 4.6.
I first started with the [CymaticLabs asset][1], but it uses RabbitMQ, which (as far as I'm aware) does not support connecting to a broker that does not use a username/password combo. If that's wrong, do let me know.
My next step was to build the .NET [binding][2] for Qpid. I got it to build in Visual Studio 2015, and once I imported the dll into my project's solution, it compiled nicely in Visual Studio. Adding the dll to plugins in Unity did not allow the project to compile in Unity. The error I received said it couldn't find the namespace of the plugin. It looks like the .NET binding is imported as a native dll (which is to be expected, I guess).
Next, I tried writing a C# wrapper for the .NET binding. After compiling it into a dll and adding it to the plugins, Unity compiled the project with no issues; however, any call to the .NET binding from the C# wrapper caused Unity to immediately crash and gave an "Invalid IL Code" error. Is using a C# wrapper for a C++ dll not possible in Unity, or am I running into another weird issue?
I haven't tried this yet, but my next step is to perform all the connection logic in the dll and make multiple static functions that just create a connection and sends/receives strings as messages. Then I think I'd be able to use the DLLImport attribute to call those static functions. Is this the right next step to take? I don't want to waste any more time trying this if it just won't work.
If anyone has any experience trying to implement AMQP in Unity, I'd greatly appreciate the help.
[1]: https://github.com/CymaticLabs/Unity3D.Amqp
[2]: https://qpid.apache.org/releases/qpid-cpp-1.36.0/messaging-api/book/ch02.html