![](/img/trans.png)
[英]How can I explicitly mark messages as poisoned in a transactional MSMQ with WCF
[英]Handling Poisoned Queue Messages in Self-Hosted WCF/MSMQ
我正在嘗試設置WCF服務來處理中毒隊列消息,而我正為此而努力。 我將WCF服務配置為:
<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>
但是,我收到此錯誤:
無法檢測隊列是否是事務性的。
和
將'serverip \\ private $ \\ services / eventservice.svc; poison'隊列路徑名轉換為格式名稱時發生錯誤:指定的隊列路徑名無效。 (-1072824300,0xc00e0014)。 排隊的通道上的所有操作均失敗。 確保隊列地址有效。 必須在啟用了Active Directory集成的情況下安裝MSMQ,並且可以對其進行訪問。
隊列路徑名稱有效,並且啟用了與Active Directory集成的MSMQ,所以我不明白為什么會發生錯誤?
編輯 :我對中毒隊列處理的服務的定義如下:
<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
好的,所以如果我理解,您的原始netMsmq毒物隊列地址會以某種方式“轉換”為字符串,然后無法將其解析為格式名稱(根據錯誤消息)。
請問您是否正在使用事務性隊列? 誠實的問題,但是您已經在綁定配置中指定了事務語義,還必須將其與服務操作實現中的適當OperationBehaviorAttribute(當然還有事務隊列)結合使用。
另外,您是否在服務實現中實現了AddressFilterMode? 對於有害消息處理,應將其設置為“ Any”,並且我認為這會對隊列地址解析產生影響,並且有害消息處理程序需要此消息。
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
public MyPoisonHanderImplementation : IMyPoisonHandler
{...}
另外,對於僅使用專用隊列時為什么需要啟用AD集成,我還是有些困惑。 還是這是另一個原因的要求?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.