简体   繁体   English

在自承载WCF / MSMQ中处理中毒队列消息

[英]Handling Poisoned Queue Messages in Self-Hosted WCF/MSMQ

I'm trying to setup a WCF service to handle poison queue messages and I'm struggling to do so. 我正在尝试设置WCF服务来处理中毒队列消息,而我正为此而努力。 I have a WCF service configured as: 我将WCF服务配置为:

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

My binding configuration is: 我的绑定配置是:

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

However, I'm getting this error: 但是,我收到此错误:

Cannot detect if the queue is transactional. 无法检测队列是否是事务性的。

And

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. 将'serverip \\ private $ \\ services / eventservice.svc; poison'队列路径名转换为格式名称时发生错误:指定的队列路径名无效。 (-1072824300, 0xc00e0014). (-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. 必须在启用了Active Directory集成的情况下安装MSMQ,并且可以对其进行访问。

The queue path name is valid, and MSMQ with Active Directory integration is enabled, so I don't understand why the error has occurred??? 队列路径名称有效,并且启用了与Active Directory集成的MSMQ,所以我不明白为什么会发生错误?

EDIT : the definition of my service for poison queue handling is the following: 编辑 :我对中毒队列处理的服务的定义如下:

<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

OK so if I understand, your original netMsmq poison queue address is somehow being "translated" into the string which then cannot be resolved to a format name (according to the error message). 好的,所以如果我理解,您的原始netMsmq毒物队列地址会以某种方式“转换”为字符串,然后无法将其解析为格式名称(根据错误消息)。

Can I ask if you're using transactional queues? 请问您是否正在使用事务性队列? Honest question, but you've specified transaction semantics in your binding configuration, which also must be coupled with the appropriate OperationBehaviorAttribute in your service operation implementation, and of course, a transactional queue. 诚实的问题,但是您已经在绑定配置中指定了事务语义,还必须将其与服务操作实现中的适当OperationBehaviorAttribute(当然还有事务队列)结合使用。

Additionally, have you implemented an AddressFilterMode on your service implementation? 另外,您是否在服务实现中实现了AddressFilterMode? For poison message handling this should be set to "Any", and I believe has an impact on queue address resolution, and is required for the poison message handler. 对于有害消息处理,应将其设置为“ Any”,并且我认为这会对队列地址解析产生影响,并且有害消息处理程序需要此消息。

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

Also I'm a little confused as to why you need to enable AD integration when you're only using private queues? 另外,对于仅使用专用队列时为什么需要启用AD集成,我还是有些困惑。 Or is this a requirement for another reason? 还是这是另一个原因的要求?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM