msmq

wcf msmq

笑着哭i 提交于 2019-11-27 04:27:42
service: namespace WcfService1 { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MsmqService" in code, svc and config file together. // NOTE: In order to launch WCF Test Client for testing this service, please select MsmqService.svc or MsmqService.svc.cs at the Solution Explorer and start debugging. public class MsmqService : IMsmqService { public void SendMsg( string message) { string file = @" C:\Users\H261285\source\repos\WcfService1\WcfService1.Client\bin\Debug\test.txt " ; lock (file) { File.AppendAllText(file, message, Encoding.Default); } } } }

The bare minimum needed to write a MSMQ sample application

人盡茶涼 提交于 2019-11-27 02:30:38
I have been researching for over an hour and finding great samples of how to use MSMQ in C# and even one full chapter of a book about Message Queue...But for a quick test all I need is to cover is this scenario, not even in a perfect way, just for a quick demo: "Application A": Writes a Message to Message Queue. ( Application A is a C# windows service) Now I open "Application B" ( it is a C# winForms app ) and I check MSMQ and I see oh I have a new Message. That's it... All I need for a simple demo. Could anyone please help me with a code sample for this? Much appreciated. Anand //From Windows

Is there a way to check how many messages are in a MSMQ Queue?

流过昼夜 提交于 2019-11-27 01:16:05
I was wondering if there is a way to programmatically check how many messages are in a private or public MSMQ using C#? I have code that checks if a queue is empty or not using the peek method wrapped in a try/catch, but I've never seen anything about showing the number of messages in the queue. This would be very helpful for monitoring if a queue is getting backed up. Gary Wright You can read the Performance Counter value for the queue directly from .NET: using System.Diagnostics; // ... var queueCounter = new PerformanceCounter( "MSMQ Queue", "Messages in Queue", @"machinename\private$

Setting permissions on a MSMQ queue in a script

∥☆過路亽.° 提交于 2019-11-26 19:37:45
问题 Can anyone give me some pointers on how to set permissions on MSMQ queues in script, preferably PowerShell, but I'd use VBscript 回答1: A present (2015) day answer to this question. Example: New-MsmqQueue -Name "MyQueue" -QueueType Private Get-MsmqQueue -Name "MyQueue" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2 Reference: https://technet.microsoft.com/en-us/library/dn391735(v=wps.630).aspx

What is “Outbound Transaction” in layman terms?

旧城冷巷雨未停 提交于 2019-11-26 17:24:59
问题 We are going to build WCF services based on SOA. During a meeting recently, client explained the new system environment. He used the word “outbound transaction”. Due to time limitations, I could not get it clarified. Then I made some search in internet. However it leads me to different topics. So, my question is - what is “Outbound Transaction” in the context of “ service orientation ”? Can you give an example? READING: What is SOA "in plain english"? What is a "web service" in plain English?

How do I prevent a WCF service from enter a faulted state?

China☆狼群 提交于 2019-11-26 15:18:41
问题 I have a WCF Service that should not enter the faulted state. If there's an exception, it should be logged and the service should continue uninterrupted. The service has a one-way operation contract and is reading messages from an MSMQ. My problems are twofold: The service appears to be swallowing an exception/fault so I am unable to debug it. How do I get the service to expose the exception so that I can log or handle it? The service is entering into a faulted state after this exception is

The bare minimum needed to write a MSMQ sample application

只愿长相守 提交于 2019-11-26 10:07:54
问题 I have been researching for over an hour and finding great samples of how to use MSMQ in C# and even one full chapter of a book about Message Queue...But for a quick test all I need is to cover is this scenario, not even in a perfect way, just for a quick demo: \"Application A\": Writes a Message to Message Queue. ( Application A is a C# windows service) Now I open \"Application B\" ( it is a C# winForms app ) and I check MSMQ and I see oh I have a new Message. That\'s it... All I need for a

Is there a way to check how many messages are in a MSMQ Queue?

≡放荡痞女 提交于 2019-11-26 09:38:53
问题 I was wondering if there is a way to programmatically check how many messages are in a private or public MSMQ using C#? I have code that checks if a queue is empty or not using the peek method wrapped in a try/catch, but I\'ve never seen anything about showing the number of messages in the queue. This would be very helpful for monitoring if a queue is getting backed up. 回答1: You can read the Performance Counter value for the queue directly from .NET: using System.Diagnostics; // ... var