MSMQ 歷險記
MSMQ Overview
保哥的心得分享,深入淺出的介紹 MSMQ,並且許多有用的連結,推薦先看這一篇
Message Queuing (MSMQ) 學習心得分享
http://blog.miniasp.com/post/2010/04/MSMQ-Message-Queuing-Learning-Notes.aspx
錯誤訊息:Access to Message Queuing system is denied
MSMQ 3.0 too secure for you?
http://blogs.msdn.com/b/johnbreakwell/archive/2007/01/15/msmq-3-0-too-secure-for-you.aspx
小熊子測試的結果,上面的選項沒有用,跨 Domain 時,直接設定 Queue 安全性屬性 ANONYMOUS_LOGON=> Full Control
Message Queuing security overview
http://technet.microsoft.com/en-us/library/cc759412%28WS.10%29.aspx
這邊有一個 step by step
http://jwbs-blog.blogspot.com/2009/06/msmq-continued.html
錯誤訊息:The Message Queuing service is not available
*檢查防火牆是否有擋下 mqsvc.exe ?
*是否有開啟 MSMQ Service ?
*檢查 MSMQ 路徑格式是否有錯?
PUBLIC=QueueGUID
DIRECT=Protocol:ComputerAddress\QueueName
DIRECT=OS:ComputerName\private$\QueueName
PRIVATE=ComputerGUID\QueueNumber
OR
DIRECT=AddressSpecification\QueueName (For public queues) DIRECT=AddressSpecification\PRIVATE$\QueueName (For private queues) DIRECT=AddressSpecification\QueueName;JOURNAL (For public queue journals) DIRECT=AddressSpecification\PRIVATE$\QueueName;JOURNAL (For private queue journals) DIRECT=AddressSpecification\SYSTEM$;computersystemqueue (Introduced in MSMQ 2.0 for the computer journal and dead-letter queues.) DIRECT=URLAddressSpecification/QueueName (Introduced in MSMQ 3.0) (小熊子常常 OS:<ComputerName> 會寫成 OS:<IP> 當然會出錯!!)
如何遠端傳送 private Queue ?
這兩篇文章很不錯
MSMQ - Sending messages to remote private queues
http://www.infosysblogs.com/microsoft/2007/02/msmq_sending_message_to_remote.html
MSMQ - Receiving messages from remote private queues
http://www.infosysblogs.com/microsoft/2007/05/msmq_receiving_messages_from_r.html
如何取得 Outgoing Queues
為什麼會需要檢查Outgoing Queue? MSMQ 在 Send Remote Queue 時,會先丟到本機的 Outgoing Queues,而且程式上不會出錯,但訊息有可能會卡在這個部份,所以需要程式化來做監控。
- 引用 COM (Microsoft Message Queue 3.0 object library ; c:\windows\system32\mqoa.dll)
- 使用 MSMQApplication.ActiveQueues 取得目前活動的 Queue
- 利用 MSMQManagement.Init 取得 MSMQOutgoingQueueManagement 物件,透由 MSMQOutgoingQueueManagement.State 來判斷是否存活
- 參考
Accessing Outgoing Message Queues (MSMQ)
http://www.codeproject.com/KB/IP/MSMQ.aspx
Monitoring MSMQ connection health in C#
http://social.msdn.microsoft.com/Forums/en/windowstransactionsprogramming/thread/72da7b77-13ff-4d11-86a7-586fd4b747da
Message Queuing COM Components(MSDN)
http://msdn.microsoft.com/en-us/library/ms704064%28v=VS.85%29.aspx
MSMQApplication(MSDN)
http://msdn.microsoft.com/en-us/library/ms703173%28v=VS.85%29.aspx
MSMQManagement(MSDN)
http://msdn.microsoft.com/en-us/library/ms711378%28v=VS.85%29.aspx
MSMQOutgoingQueueManagement(MSDN)
http://msdn.microsoft.com/en-us/library/ms701455%28v=VS.85%29.aspx
如何取得 Queue 裡的訊息數
- 這個方法好,而且是純 .net
Counting Messages in an MSMQ MessageQueue from C#
http://jopinblog.wordpress.com/2008/03/12/counting-messages-in-an-msmq-messagequeue-from-c/ - 這篇提到兩種作法
1.用 Performance Counter - MSMQ Queue 取得
2.用 COM (Microsoft Message Queue 3.0 object library ; c:\windows\system32\mqoa.dll) 取得
也可以參考
Counting messages in Queue - the .NET version
http://msmq.spaces.live.com/blog/cns!393534E869CE55B7!121.entry - 這篇也是用 COM
Accessing Outgoing Message Queues (MSMQ)
http://www.codeproject.com/KB/IP/MSMQ.aspx - 這篇用 P/Invoke 取得 MQMgmtGetInfo
Counting the number of messages in a Message Queue in .NET
其他
MessageQueueErrorCode.cs 錯誤代碼對照
http://www.koders.com/csharp/fidE632059BF610D9D912C019A96DCF7A2DD76C847F.aspx
MessageQueueErrorCode Enumeration(MSDN)
http://msdn.microsoft.com/en-us/library/system.messaging.messagequeueerrorcode%28VS.80%29.aspx
沒有留言:
張貼留言