誰かがこれを理解する必要がある場合に備えて、私の解決策を投稿する
NetMSMQBinding
クライアント側からのメッセージ優先度の設定をサポートしていないため、間違ったバインディングを使用していました。より強力なMsMqIntegrationBinding
のは正しい道です。
クライアント側:クライアント側からは、オブジェクトを作成し、優先度を設定して、宛先MQを指すオブジェクトにSystem.Messaging.Message
ドロップするだけです。MessageQueue.MessageQueue
サーバー側:WorkflowService
ホスティングWCFプロジェクトには、web.configに次のendpointBindingが必要です。
<endpoint address="msmq.formatname:DIRECT=OS:.\private$\MyWebService/MyProcessingService.xamlx"
binding="msmqIntegrationBinding"
bindingConfiguration="MyMsMqIntegrationBinding"
contract="IMyProcessingService"
name="MqIntegrationBindingEndPoint"
/>
(アドレスは、MQサービスがホストされているWCFに対してローカルであると想定しています)
<bindings>
<!--We use msmqIntegrationBinding instead of netMsmqBinding since we want to control priority of MQ messages being dropped in the queue
and that is not supported in netMsmq
-->
<msmqIntegrationBinding>
<binding name="MyMsMqIntegrationBinding" exactlyOnce="false">
<security mode="None" />
</binding>
</msmqIntegrationBinding>
MQからMsmqMessageを受信して処理する方法は、XAMLXに「Receive」アクティビティをドロップしMessage
、コンテンツ定義MessageTypeとして選択するSystem.ServiceModel.MsmqIntegrationMessage<YourTypeGoesHere>
ことです。これMsmqMessage<yourType>
で、からActivityContext
送信された値を取得できるようになります。メッセージ。
これは、優先度制御MQ + WCF+WFベースのWebサービスでスケーラブルなスロットルを構築するための非常に便利で強力な方法です。