Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multicast with MSMQ and C#

525 views
Skip to first unread message

TDD

unread,
Apr 2, 2003, 11:15:13 AM4/2/03
to
I am evaluating MSMQ's performances using multicast queues
with C#.
The first conclusions I have come to are that using
multicast is much, much slower.
For example, when sending and receiving 100Kb takes a few
milliseconds, doing the same thing with a multicast queue
takes several seconds.
Processing 2Mo messages will take a few more milliseconds,
but approximately 10sec with multicast.
I wonder if I am really using multicast the right way, so
here is the way I proceed :

Computer A and computer B are running under Windows XP.
Computer C is a domain controller running under Windows 2K
Server.
LAN speed is 100Mb/s.
Time synchronization using : "net time" shell command.

A private queue is created on computer B and associated
with a multicast address.

Computer A sends a 100Kb message to the multicast queue.
Computer B is receiving asynchronously on its local queue.

Sample code :
1-Sender :
private void MulticastSend()
{
MessageQueue myQ = new MessageQueue
("FormatName:MULTICAST=236.1.1.1:8001");
myQ.MessageReadPropertyFilter.SentTime = true;
myQ.MessageReadPropertyFilter.ArrivedTime = true;
System.Messaging.Message myMsg = new
System.Messaging.Message();
myMsg.Body = m_ByteArray;
myQ.Send(myMsg);
return;
}
2-Receiver (asynchronous)
private void Q_ReceiveCompleted(object sender,
System.Messaging.ReceiveCompletedEventArgs e)
{
MessageQueue myQ = (MessageQueue)sender;
myQ.MessageReadPropertyFilter.SentTime = true;
myQ.MessageReadPropertyFilter.ArrivedTime = true;
myQ.Formatter = new XmlMessageFormatter(new Type[]
{typeof(byte[])});
System.Messaging.Message myMsg = myQ.EndReceive
(e.AsyncResult);
myQueue.BeginReceive();
return;
}

Thank you for telling me how to use multicast correctly
(especially in the sender side), and if MSMQ is supposed
to take much more time when using multicast than when not
using (are the SentTime and ArrivedTime message properties
relevant ?).

0 new messages