2015-04-15 89 views
1

我想設置一個WCF服務來處理毒隊列消息,我正在努力這樣做。我已經配置了一個WCF服務爲:處理自我託管的WCF/MSMQ中毒隊列消息

<endpoint address="net.msmq://serverip/private/services/eventservice.svc;poison" 
    binding="netMsmqBinding" 
    bindingConfiguration="MsmqBindingTransactionalSecurityPoisonHandling" 
    contract="App.IEventService" /> 

我綁定的配置是:

<binding name="MsmqBindingTransactionalSecurityPoisonHandling" exactlyOnce="true" durable="true"> 
     <security mode="None" /> 
</binding> 

不過,我得到這個錯誤:

Cannot detect if the queue is transactional.

而且

An error occurred when converting the 'serverip\private$\services/eventservice.svc;poison' queue path name to the format name: The queue path name specified is invalid. (-1072824300, 0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.

隊列路徑名稱有效,MSMQ與Active Directory集成已啓用,所以我不明白爲什麼發生錯誤?

編輯:我對有害隊列處理服務的定義如下:

<ServiceBehavior(AddressFilterMode:=AddressFilterMode.Any, InstanceContextMode:=InstanceContextMode.Single, ConcurrencyMode:=ConcurrencyMode.Single)> 
Public Class EventService 
    Implements IEventService 

    <OperationBehavior(TransactionScopeRequired:=True, TransactionAutoComplete:=True)> 
    Public Sub ProcessEvent(msg As EventMessage) Implements IEventService.ProcessEvent 

    End Sub 
End Class 
+0

根據錯誤消息,您在隊列路徑中混合了正斜槓和反斜槓。這是一個錯字嗎? –

+0

MSMQ上的WCF只使用正斜槓;它會被翻譯。例如,我成功地通過net.msmq://serverip/private/services/eventservice.svc發出連接到主隊列的服務請求。這只是我不知道的毒素子隊列連接。 –

回答

1

OK,所以如果我明白了,原來的netMsmq有害隊列地址不知何故被「翻譯」成的字符串,然後無法解析爲格式名稱(根據錯誤消息)。

我可以問你是否使用事務隊列嗎?誠實的問題,但你已經在你的綁定配置中指定了事務語義,它也必須與你的服務操作實現中適當的OperationBehaviorAttribute相結合,當然還有一個事務性的隊列。

此外,你是否在你的服務實現上實現了AddressFilterMode?對於中毒消息處理,應該將其設置爲「Any」,並且我認爲它對隊列地址解析有影響,並且是毒害消息處理程序所必需的。

[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] 
public MyPoisonHanderImplementation : IMyPoisonHandler 
{...} 

另外我有點困惑,爲什麼當你只使用私有隊列時需要啓用AD集成?或者這是另一個原因的要求?

+0

我正在使用事務隊列;我在上面列出了我的服務實現的shell。謝謝。 –

+0

@BrianMains - 然後我難住 - 道歉不能有更多的幫助。仍然不確定爲什麼需要AD集成? –

+0

是的,它是奇怪的,但至少你已經審查過,我的方法應該沒有問題,所以我必須在我的最後做一些額外的驗證。謝謝。 –

相關問題