msmq

“Category does not exist.” Creating performance counter for MSMQ Queue

喜你入骨 提交于 2019-12-10 19:51:06
问题 I am attempting this: using System.Diagnostics; // ... var queueCounter = new PerformanceCounter( "MSMQ Queue", "Messages in Queue", @"machinename\private$\testqueue2"); Console.WriteLine( "Queue contains {0} messages", queueCounter.NextValue().ToString()); Which came from this post: Is there a way to check how many messages are in a MSMQ Queue? There is mention of this same error, but no resolution when using PerformanceCounter. I also found mention here: Performance Counter - System

MSMQ slow queue reading

我们两清 提交于 2019-12-10 18:46:04
问题 I am using an open source .Net library which uses MSMQ underneath. After about a week or 2, the service slows down (not timed exactly but general guess). It appears that what is happening is messages from MSMQ are only being read exactly once every 10 seconds. Normally, they are read instantly. So they will be read at T+10sec, T+20sec, T+30sec, etc. independent of when the message was sent (i.e. sometimes it takes 3 seconds for the message to be read, other times 9 seconds). The current way I

how can i get all the available messages on a MSMQ Queue

不羁岁月 提交于 2019-12-10 18:37:11
问题 Whats the best way to get all the messages currently on a queue to process? We have a queue with a large number of very small messages, what I would like to do is read all the current messages off and then send them through a thread pool for processing. I can't seem to find any good resource which will show me how i can create a simple method to return an IEnnumerable for example Thanks 回答1: Although I agree with Nick that the queue's purpose is more for FIFO style processing, and ArsenMkrt's

MSMQ consuming large amounts of memory when processing messages with NServiceBus

…衆ロ難τιáo~ 提交于 2019-12-10 17:49:25
问题 I have two windows services which use NserviceBus. One writes messages to the queue and the other reads from it and do some processing. All the queues are transactional and the NserviceBus endpoints are configured as below. .IsTransactional(true) .IsolationLevel(IsolationLevel.ReadCommitted) .MsmqTransport() .RunTimeoutManager() .UseInMemoryTimeoutPersister() .MsmqSubscriptionStorage() .DisableRavenInstall() .JsonSerializer() The issue is when a large amount of messages (170,000+) are queued,

How do I set the owner of a message queue?

房东的猫 提交于 2019-12-10 17:38:38
问题 The System.Messaging.MessageQueue class does not provide a way to set ownership of queue. How do I programmatically set the owner of a MSMQ message queue? 回答1: The short answer is to p/invoke a call to the windows api function MQSetQueueSecurity void SetOwner(MessageQueue queue, byte[] sid, bool ownerDefaulted = false) { var securityDescriptor = new Win32.SECURITY_DESCRIPTOR(); if (!Win32.InitializeSecurityDescriptor(securityDescriptor, Win32.SECURITY_DESCRIPTOR_REVISION)) throw new

Out of order messages possible with transactional queues in MSMQ?

有些话、适合烂在心里 提交于 2019-12-10 16:46:42
问题 I'm new to messaging and a little unclear as to whether it is possible for MSMQ to deliver out-of-order messages for transactional queues. I suppose it must be because if a message is not processed correctly (and since we will be using multiple "competing consumers"), then other consumers could continue to process messages while the failed message is placed back on queue. Just can't seem to find a black-and-white answer anywhere on this. 回答1: Negative black-and-white answer are hard to find(

What would cause MSMQ to place messages destined for queues on the local system into the “Outgoing Queues”?

倖福魔咒の 提交于 2019-12-10 14:33:28
问题 MSMQ maintains a type of queue called "Outgoing Queues". These queues are used by the MSMQ service to hold messages destined for servers that it cannot contact when the message is generated. These are special, temporary queues that are separate from the normal Public and Private queues. I've recently encountered a scenario where some messages destined for the local system (i.e. the same computer that generated the message) end up in one of the "Outgoing Queues". When drilling into the

MSMQ CreateCursor NullReferenceException

给你一囗甜甜゛ 提交于 2019-12-10 13:40:11
问题 I have a website that uses MSMQ on a remote server to queue pending e-mails. I am able to write the message to the queue, and then call dispose on the queue. The queue still gets the message, but sometime later the GC comes along and tries to clean up and it causes IIS to crash. This is what I see in the event log: Exception: System.NullReferenceException Message: Object reference not set to an instance of an object. StackTrace: at System.Messaging.Cursor.Finalize() This code has been running

Sending message to message queue on my machine…Error “Invalid queue path name” [closed]

浪子不回头ぞ 提交于 2019-12-10 12:45:53
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am sending a message to a pretty standard message queue that I have created on my machine running Windows Server 2008 R2. QueueName: directionsTest

Check the status and result of MSMQ message

混江龙づ霸主 提交于 2019-12-10 10:59:19
问题 I'm working on a RESTfull web service that does the following: On POST request, it starts a long running task. It queues up a message for MSMQ, which is processed in windows service hosted applicaiton. It returns HTTP status code 202 Accepted along with id of the job we queued up. Client application continously polls the service (with GET) with id of the job we just queued up. When the MSMQ client is finished with the task, it should return the result of the operation. If not, it will return