开发者

.Net Msmq How to find conflicts in Msmq

I have one Msmq Queue which contain value like 1,2,3,4. Before inserting other values 开发者_高级运维in my Msmq I check the conflict in Msmq means when I insert 1 it is not inserted in to Msmq. This is how I achieve the check:

I read the message from Msmq and then check with my newly inserted value

but problem is when I read this message from Msmq then first message is deleted from Msmq. I don't want this. Is their another way for this?


If you wish to view the contents of a message on MSMQ without removing it, use Peek() or one of its overloads:

http://msdn.microsoft.com/en-us/library/829zyck7.aspx


This has the potential to get messy very quickly; a better solution might be to add the item to the queue irrespective of whether it already exists and design the recieving end such that it ignores duplicate messages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜