2009-04-08 17 views
5

के साथ आदेश दिया गया डिलिवरी WCF netMSMQbinding का उपयोग करते समय आदेशित डिलीवरी की गारंटी देना संभव है?netMSMQbinding

हम एक कतार कमांड डाल रहे हैं जिसके बाद एक ही कतार पर कई अद्यतन कमांड हैं, और मौलिक रूप से अद्यतनों में से एक डालने से धड़कता है।

व्यापक लॉगिंग जोड़ने के बाद यह स्पष्ट है कि उन्हें सही क्रम में कतार में जोड़ा जा रहा है और एक अलग क्रम में संसाधित किया जा रहा है।

मैंने Google को कुछ लेख प्रबंधित किए हैं जो बताते हैं कि यह व्यवहार अपेक्षित है, लेकिन ऐसा लगता है कि इसे किसी भी तरह से आदेश देने के लिए कॉन्फ़िगर करना संभव है।

हमारी कतारों व्यवहार कर रहे हैं, तो मुझे नहीं लगता कि अनुक्रम संख्या को जोड़ने और गंतव्य पर resequencing के रूप में है कि बाहर transactionality

खो देगा, काम करने के लिए जा रहा है कि मैं विशेषता [DeliveryRequirements(RequireOrderedDelivery=true, QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.Require)] मैं निम्नलिखित त्रुटि मिलती है जोड़ते हैं :

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.

मुझे नहीं पता कि हमें यह त्रुटि क्यों मिलती है, क्योंकि सबकुछ ठीक से "प्रकट होता है"। मुझे कोई पुष्टि नहीं मिली है कि एमएसएमक्यू के लिए इस सेटिंग की अनुमति है, क्योंकि यह डब्लूएस-आरएम सेटिंग प्रतीत होता है, और AFAIK netMSMQBinding WS-RM का समर्थन नहीं करता है।

+0

मैं इस विषय पर एक कनेक्ट बग दायर की, नहीं बिल्कुल एक ही मुद्दे के रूप में आप था, लेकिन काफी पास ... मैं भी एक समाधान है कनेक्ट बग में। इसे यहां देखें: https://connect.microsoft.com/VisualStudio/feedback/details/1107645/wcf-receives-messages-from-msmq-out-of-order –

उत्तर

3

एमएसएमक्यू आदेशित डिलीवरी का समर्थन नहीं करता है, इसलिए आप नहीं कर सकते हैं।

System.ServiceModel.Channels.MsmqBindingElementBase + BindingDeliveryCapabilitiesHelper पर एक नज़र जो वर्ग MSMQ के बंधन क्षमताओं को निर्दिष्ट है ले लो, और कैसे यह है कि संपत्ति को लागू करता है:

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

बिल्कुल सही। बस निश्चित जवाब मैं देख रहा था। मैं अब दिन के नौकरी पर वापस आ सकता हूं :) – Modan

1

ऐसा लगता है कि समूह के संदेश कर सकते हैं, इसलिए आप अनुबंध में आदेश निर्दिष्ट कर सकता है। यह MSDN article on grouping messages देखें।

2

This post from Simon Gittins लगता है कि यह पता चलता है कि आदेश दिया वितरण संभव है:

As it turns out, there's an undocumented feature that deals with this situation:

  • Apply a TransactedBatchingBehavior with a batch size of ONE to the service endpoint.
  • ReleaseServiceInstanceOnTransactionComplete must be set to true on the service implementation.

Once these two things are done, my test program no longer produces out of order messages.

+0

दरअसल, 'रिलीज सेवा सर्विस ऑनऑनट्रैक्शन कॉम्प्लेटी' को 'झूठी' पर सेट किया जाना चाहिए (जैसा कि [उसी धागे] के अंतिम पोस्ट में कहा गया है (http://social.msdn.microsoft.com/फ़ोरम/en-us/WCF/धागा/D5E62C68-08FA-492C-BA05-182EC313A54B))। इसे सत्य पर सेट करने से रनटाइम में सक्रियण अपवाद होता है। अन्यथा यह आदेश को ठीक करने लगता है। – htuomola