我在遠程計算機上有一個名爲log的隊列。當我在本地調用該隊列,我修改我的NetMsmqBinding指定自定義死信隊列:無法從(死信)隊列獲取服務
_binding.DeadLetterQueue = DeadLetterQueue.Custom;
_binding.CustomDeadLetterQueue = new Uri(
"net.msmq://localhost/private/Services/Logging/LogDeadLetterService.svc");
也能正常工作;當我強制我的信息無法到達目的地時,它會出現在這個隊列中。
現在,我有一個託管在IIS/WAS中的服務來讀取死信隊列。它託管在一個名爲Services的站點上,位於Services/Logging/LogDeadLetterService.svc。下面是我的配置服務:
<service name="Me.Logging.Service.LoggingDeadLetterService">
<endpoint binding="netMsmqBinding"
bindingNamespace="http://me.logging/services/2012/11"
contract="Me.Logging.Service.Shared.Service.Contracts.ILog" />
</service>
這是我的激活:
<add relativeAddress="LogDeadLetterService.svc"
service="Me.Logging.Service.LoggingDeadLetterService" />
我實際的服務基本上是這樣的:
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any, // Pick up any messages, regardless of To address.
InstanceContextMode = InstanceContextMode.Single, // Singleton instance of this class.
ConcurrencyMode = ConcurrencyMode.Multiple, // Multiple callers at a time.
Namespace = "http://me.logging/services/2012/11")]
public class LoggingDeadLetterService : ILog
{
public void LogApplication(ApplicationLog entry)
{
LogToEventLog(entry);
}
}
我的隊列是事務性和認證。我在服務站點和日誌記錄應用程序中都將net.msmq包括爲已啓用的協議,並且我在服務站點上添加了net.msmq綁定。如果我有綁定信息爲appdev.me.com
,我得到的瀏覽到http://appdev.me.com/Logging/LogDeadLetterService.svc時,下面的錯誤(appdev.me.com是建立在我的HOSTS文件):
An error occurred while opening the queue:Access is denied. (-1072824283, 0xc00e0025).
如果我有綁定信息爲localhost
,我得到以下錯誤:
An error occurred while opening the queue:The queue does not exist or you do not have sufficient permissions to perform the operation. (-1072824317, 0xc00e0003).
無論哪種方式,我有它設置,服務不拿起一紙空文,因爲它仍然在隊列中,而不是在我的事件日誌。
現在,我意識到這兩個引用權限問題。然而,爲了在測試之前獲得測試代碼的一部分,我已經給予了我所能想到的所有人 - 包括Everyone,Authenticated Users,NETWORK SERVICE,IIS_USERS,ANONYMOUS LOGON和我自己。 (應用程序池與我一樣運行。)
任何關於如何讓我的服務能夠從這個隊列中拉出的幫助將是驚人的。謝謝!
編輯:根據this MSDN blog entry,0xC00E0003對應MQ_ERROR_QUEUE_NOT_FOUND,並0xc00e0025相當於MQ_ERROR_ACCESS_DENIED,所以它看起來像我希望有綁定信息appdev.me.com
。但是,這仍然無法解決發生的明顯權限問題。
EDIT2:,如果我在一個控制檯應用主機服務,並提供以下端點它的工作原理:
<endpoint address="net.msmq://localhost/private/Services/Logging/LogDeadLetterService.svc"
binding="netMsmqBinding"
bindingNamespace="http://me.logging/services/2012/11"
contract="Me.Logging.Service.Shared.Service.Contracts.ILog" />
那麼是什麼在控制檯應用程序比IIS是怎麼回事不同的事?我非常有信心,由於編輯以上,我正在排隊。那麼爲什麼我不能進入呢?
EDIT3:每給here建議變更的服務/日誌/ LogDeadLetterService.svc到記錄/ LogDeadLetterService.svc,但沒有任何變化。
//
[獎金的問題:我需要在我的死信隊列處理有害消息?]
完全控制「每個人」 – Didaxis
OP已經表示他這樣做了。 –
@ErOx:休是正確的;我已經授予所有人完全控制權。 – zimdanen