使用netMSMQbinding的有序交付 [英] Ordered Delivery with netMSMQbinding

查看:76
本文介绍了使用netMSMQbinding的有序交付的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用WCF netMSMQbinding时是否可以保证有序交付?

Is it possible to guarantee ordered delivery when using WCF netMSMQbinding?

我们在同一队列中放置了插入命令,后面跟着许多更新命令,有时其中一个更新胜过插入.

We are putting an insert command followed by a number of update commands on the same queue, and occassionally one of the updates beats the insert.

添加了广泛的日志记录后,很明显,它们以正确的顺序添加到队列中并以不同的顺序进行处理.

Having added extensive logging it is clear that they are being added to the queue in the correct order and being processed in a different order.

我已经设法在Google上发表了几篇文章,指出这种行为是可以预期的,但是似乎必须可以将其配置为以某种方式进行订购.

I have managed to Google a couple of articles that state that this behaviour is expected, but it seems like it must be possible to configure it to be ordered somehow.

我们的队列是事务性的,所以我认为在目的地添加序列号和重新排序不会起作用,因为那样会失去事务性

Our queues are transactional, so I don't think that adding sequence numbers and resequencing at the destination is going to work, as that would lose out transactionality

如果添加属性[DeliveryRequirements(RequireOrderedDelivery=true, QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.Require)],则会出现以下错误:

If I add the attribute [DeliveryRequirements(RequireOrderedDelivery=true, QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.Require)] I get the following error:

合同"IService"上的DeliveryRequirementsAttribute指定一个 NotAllowed的QueuedDeliveryRequirements值.但是,配置 该合同的绑定指定它确实支持排队交付.一种 队列绑定可能无法与此合同一起使用.

The DeliveryRequirementsAttribute on contract 'IService' specifies a QueuedDeliveryRequirements value of NotAllowed. However, the configured binding for this contract specifies that it does support queued delivery. A queued binding may not be used with this contract.

我不知道为什么会出现此错误,因为一切似乎"都已正确设置.我尚未设法确认此设置允许用于MSMQ,因为它似乎是WS-RM设置,并且AFAIK netMSMQBinding不支持WS-RM.

I have no idea why we get this error, as everything "appears" to be setup correctly. I haven't managed to find any confirmation that this setting is allowed for MSMQ though, as it appears to be a WS-RM setting, and AFAIK netMSMQBinding does not support WS-RM.

推荐答案

MSMQ不支持有序交付,因此您不能.

MSMQ does not support ordered delivery, hence you can not.

看看System.ServiceModel.Channels.MsmqBindingElementBase + BindingDeliveryCapabilitiesHelper,它是指定MSMQ的绑定功能以及如何实现该属性的类:

Take a look at System.ServiceModel.Channels.MsmqBindingElementBase+BindingDeliveryCapabilitiesHelper which is the class specifying MSMQ's binding capabilities, and how it implements that property:

bool IBindingDeliveryCapabilities.AssuresOrderedDelivery
{
    get
    {
        return false;
    }
}

这篇关于使用netMSMQbinding的有序交付的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆