-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider extracting System.ServiceModel reliant code into seperate assembly #57
Comments
We have heard such requests before. @osudude would you be interested in working on a pull request that does this? Our development process is fairly straightforward and we have a tiny team, so this likely won't be a high priority. But we are open to including this change (for 3.6.0, because I suppose this will break existing apps). Thank you! |
I'll take a look at it. If not crazy hard, will try to make the change and submit a pull request. Date: Fri, 10 Apr 2015 08:09:12 -0700 We have heard such requests before. @osudude would you be interested in working on a pull request that does this? Our development process is fairly straightforward and we have a tiny team, so this likely won't be a high priority. But we are open to including this change (for 3.6.0, because I suppose this will break existing apps). Thank you! — |
@michaelklishin Quick question, I removed the assembly reference to System.ServiceModel from RabbitMQ.Client and surprisingly everything seems to build without error. What code in RabbitMQ.Client actually uses System.ServiceModel? thanks |
@osudude pretty sure nothing in the client code should depend on |
So for the windows build of the client assembly it is safe to remove the System.ServiceModel assembly reference? Is there a good unit test I can run to verify nothing is broken or do I just need to go manually try it out? thanks |
You can run the client test suite. We'll do it to verify your PR anyway :)
|
Installed Rabbit 3.51 and Erlang on my dev box (win2012). Tried the tests inside of Visual Studio 2013 using resharper test runner. Is there an assumed relationship of test code location to installed rabbit location? I get several errors like the following: Failure while running cmd.exe /c ""............\rabbitmq-server\scripts\rabbitmqctl.bat" -n rabbit@SMPC2 list_connections -q pid peer_port": Failure while running cmd.exe /c ""............\rabbitmq-server\scripts\rabbitmqctl.bat" -n rabbit@SMPC2 set_vm_memory_high_watermark 0.4": waiting on a latch timed out at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args) thanks |
You need to run rabbitmq-server from the umbrella, or make sure |
Got the umbrella project. Getting new test errors now. Guess I need to build the umbrella? How do you build the umbrella on a Visual Studio 2013 / windows machine? SetUp : RabbitMQ.Client.Exceptions.BrokerUnreachableException : None of the specified endpoints were reachable |
You need to start RabbitMQ:
|
Also, unless you configure the server to enable TLS, provide certificates and key, etc, you will see 5 failures saying that broker on port 5671 is not reachable. Don't worry about it. |
C:\Dev\GitHub\rabbitmq\rabbitmq-public-umbrella [master]> make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
Sorry for the nube question, @michaelklishin but where do I get make? Running Win2012 server / VS2013 / Github powershell extension |
Is there a specific branch for Rabbitmq client .NET 3.5? |
Looks like the .net 3.5 version of rabbitmq-client was 3_4_3. Looking at the 3_4_3 version of Rabbit client, it appears the dependency on System.ServiceModel is due to the use of SynchronizedCollection. Strange that SynchronizedCollection is in System.ServiceModel as this is a relatively generic class. |
@osudude even more so that most of its public instance methods are not synchronised at all. Thank you for digging this out. Would requiring .NET 4.5 provide an alternative? |
Eventually, .NET 4.5 will be on the table once we upgrade from SQL2008 to SQL2014. Until then, looks like we are stuck with RabbitMQ 3_4_3. Won't help now, but I did write up a MS Connect issue to move SynchronizedCollection: Found another spot where SQL CLR is not happy with RabbitMQ 3_4_3 "RabbitMQ.Client' has a static field 'DefaultAuthMechanisms'. Attributes of static fields in safe assemblies must be marked readonly in Visual C#, ReadOnly in Visual Basic, or initonly in Visual C++ and intermediate language." Had to modify ConnectionFactory by adding readonly modifier like so: public static readonly AuthMechanismFactory[] DefaultAuthMechanisms = |
@osudude feel free to submit small PRs against master. We're all for supporting SQL CLR, even if it'd have to be a newer version. Should we close this issue and file a new more specific one? As I understand the root problem is in .NET itself. |
Here is one last change I had to make for SAFE CLR use on Rabbit 3_4_3 "CREATE ASSEMBLY failed because type 'RabbitMQ.Client.Framing.Impl.Connection' in safe assembly 'RabbitMQ.Client' has a static field 'HandshakeTimeout'. Attributes of static fields in safe assemblies must be marked readonly in Visual C#, ReadOnly in Visual Basic, or initonly in Visual C++ and intermediate language." Had to add readonly modifier to HandshakTimeout in Connection.cs: public static readonly int HandshakeTimeout = 10000; |
Both of the changes make sense and are something we'd accept ;) |
You can close this issue if you want. Only had to do 2 things to get Rabbit 3_4_3 up to snuff for SAFE CLR use.
thanks |
Thanks, I am now mucking around with CAS permissions in SQL CLR. Seems like default behavior is to block DNS and external threading access to CLR procs. I'm sure there is a way around it. Just trying to figure out how to make that happen in SQL. |
@michaelklishin Is RabbitMQ DotNet client strong named? |
@osudude yes, releases are signed with a key. Unoffficial (local) builds are, too, if you provide a key. |
@osudude see Strong Naming on our download page. |
@michaelklishin Finally got my local modified build of RabbitMQ.Client 3_4_3 to work in SQL targeting .NET 3.51. In SQL, you have to register the RabbitMQ.Client assembly as unsafe or external access because it requires network access and external threading. I still need to try out your latest master build targeting .NET 4.51 in SQL 2014. |
@michaelklishin Just tried out the master build with your latest changes for SQL2014 CLR. Works great in SQL2014 targeting .NET 4.5 (assuming you register the assemblies with SQL correctly). thanks |
@michaelklishin I noticed the assemblyinfo.cs get dynamically swapped out at build time using the version from Local.Props. That's cool. Is this a custom build task that does this? |
@osudude yes, "detokenize". It's based on MSBuild community tasks, specifically TemplateFile. |
Would like to use RabbitMQClient.dll in MSSQL CLR but it is blocked by SQL because of the System.ServiceModel dependency (System.ServiceModel is considered unsafe by SQL).
It would be nice if the rabbit code that relies on System.ServiceModel could be extracted to a separate optional assembly.
The text was updated successfully, but these errors were encountered: