What benefit would I get when using MessageQueueTransaction with ReceiveCompleted event in MessageQu
Posted
by Jeffrey
on Stack Overflow
See other posts from Stack Overflow
or by Jeffrey
Published on 2010-05-12T23:43:19Z
Indexed on
2010/05/12
23:54 UTC
Read the original article
Hit count: 161
I understand the benefit when using MessageQueueTransaction in the below scenario where 5 messages will be wrapped in a single transaction and until the transaction has been committed 5 individual ReceiveCompleted events will then be raised.
using(var t = new MessageQueueTransaction())
using(var q = new MessageQueue("queue path here"))
{
t.Begin();
q.Send(new Message);
q.Send(new Message);
q.Send(new Message);
q.Send(new Message);
t.Commit();
}
I understand the usefulness when using Peek() and Receive() which has been mentioned in this question. However I am wondering would I get any benefit when combining MessageQueueTransaction with ReceiveCompleted event.
© Stack Overflow or respective owner