system.messaging

with MessageEnumerator RemoveCurrent how do I know if I am at end of queue?

余生长醉 提交于 2020-01-24 04:25:28
问题 In MSMQ on .NET, I'm using a MessageEnumerator to look through all the messages in the queue. I want to remove messages that meet a certain condition. When I call MoveNext to step through the queue, I get back a boolean to tell me if the current message exists. But, when I do a RemoveCurrent, how do I know if the current message after the removal exists? Is the only way to check Current and handle the exception? Here is an example where I use the simple condition of removing messages that are

MSMQ messages disappear when they get to remote server

萝らか妹 提交于 2020-01-02 16:54:06
问题 I have to create a MSMQ messaging mechanism between two servers in the same domain, SenderServer (MS Server 2012) and ReceiverServer (MS Server 2008 R2). I created a private, transactional queue in ReceiverServer .\private$\receiver , I gave receive (and peek) message rights to system and administrators. I then created a client application that creates and forwards messages to the queue by using the following code: MessageQueue queue = new queue("FormatName:Direct=OS:ReceiverServer\private$

How to move a msmq message to a subqueue

对着背影说爱祢 提交于 2019-12-23 10:28:49
问题 Using the System.Messaging classes, how do I move a msmq message (in this case a poison message) to a subqueue? Seems like this should be simple, but I haven't been able to figure it out. 回答1: This does not appear to be possible. Ayende resorts to the unmanaged API in Rhino Service Bus, and if he can't do it then I certainly can't. 回答2: For the record, I just learned today via a colleague that Microsoft finally added support for addressing subqueues in 4.0. 来源: https://stackoverflow.com

The queue does not exist or you do not have sufficient permissions to perform the operation. exception while sending message via MSMQ

别等时光非礼了梦想. 提交于 2019-11-30 17:34:02
问题 I have created a function to send message via MSMQ but getting exception while executing. below is my function. public void SendMessageToQueue(ChessQueue chessQueue) { MessageQueue queue = null; Message m = null; if (!MessageQueue.Exists(".\\Private$\\" + chessQueue.QueueName)) { queue = new MessageQueue(".\\Private$\\chessqueue"); chessQueue.Messages = new List<MessageObject>(); chessQueue.Messages.Add(chessQueue.Message); queue.Formatter = new BinaryMessageFormatter(); m = new Message(); m

The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted

浪尽此生 提交于 2019-11-29 16:52:28
I'm trying to send a message to a queue using a Message object and am getting the error The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted. Here is the code. Order ord = new Order(new Guid(), "Smith & Smith"); Message orderMessage = new Message(ord); orderMessage.UseEncryption = true; orderMessage.EncryptionAlgorithm = EncryptionAlgorithm.Rc2; orderMessage.Recoverable = true; orderMessage.Priority = MessagePriority.VeryHigh; orderMessage.TimeToBeReceived = TimeSpan.FromHours(1); orderMessage.UseJournalQueue = true;

The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted

半腔热情 提交于 2019-11-28 10:36:47
问题 I'm trying to send a message to a queue using a Message object and am getting the error The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted. Here is the code. Order ord = new Order(new Guid(), "Smith & Smith"); Message orderMessage = new Message(ord); orderMessage.UseEncryption = true; orderMessage.EncryptionAlgorithm = EncryptionAlgorithm.Rc2; orderMessage.Recoverable = true; orderMessage.Priority = MessagePriority