Reputation: 190
I have installed ActiveMQ 5.13.0 Release on the server and trying to access the broker with C# client. I created a console application and installed Apache.NMS.ActiveMQ version 1.7.1 nuget package. When I try to access the broker:
Line 1 Uri uri = new Uri("tcp://192.168.110.136:61616");
Line 2 NMSConnectionFactory NMSFactory = new NMSConnectionFactory(uri);
On the second line it throws No IConnectionFactory implementation found for connection URI: tcp://192.168.110.136:61616/ exception.
Project's .NET Framework version is 3.5 and I also tried with .NET 4.0 and 4.5 as well. But the result is same, throws the same exception.
ActiveMQ is running on the server and I am able to access to the server's 61616 port with telnet and the management UI. I checked other similar posts but did not help to fix the issue. Any help is welcome.
Thanks.
Upvotes: 8
Views: 10528
Reputation: 463
If anyone knows what is the difference between please explain.
In my project I had used a very old version (1.1) of Apache.NMS.ActiveMQ and it came with a file named nmsprovider-activemq.config.
When I upgraded I got into the same type of problems you observed.
What I found is that NMSConnectionFactory differs from earlier versions.
Simply loading the ActiveMQ assembly yourself and instantiate its factory is less complicated, but I guess switching between various factories becomes more of a chore then. The practical result (if you only care about one type of factory) is the same however. NMSFactory's main mission is to locate the factory class of the chosen provider.
The final pitfall when upgrading this assembly is that calling .Start() on the connection object is now required.
TL;DR: Check if you have the config file I mentioned. Either edit it (get rid of the .dll file extension) or remove it completely (it probably does not contain any info not already hard coded into the Apache.NMS assembly)
Upvotes: 1
Reputation: 18356
First, be sure that your applications references both the Apache.NMS.dll and the Apache.NMS.ActiveMQ.dll assemblies in order to have access to all the implementation bits.
Then try using a URI that references the provider implementation you are trying to use via the generic NMSConnectionFactory:
Uri uri = new Uri("activemq:tcp://192.168.110.136:61616");
Optionally you can use the ActiveMQ IConnectionFactory implementation directly:
IConnectionFactory factory = new Apache.NMS.ActiveMQ.ConnectionFactory(uri);
Upvotes: 17