I'm looking for the equivalent of FileSystemWatcher for a specific MSMQ queue. Does something like that exist or do I need to roll my own?
Thanks!
Isn't that basically what MQReceiveMessage does? My apologies for referencing the C docs, but all of this functionality should be available to .NET. Essentially you can use this function to peek at messages in the queue:
When reading messages, you can either peek at (not removing them) or retrieve the messages (removing them) in the queue.
And you can use it to block until a message is ready:
Processing is blocked in the applicable thread until a message is found in the queue (this is the default setting).
Apparently you can also use this function to receive messages asynchronously, in which case it would operate much like the FileSystemWatcher.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With