簡體   English   中英

帶有Apache ActiveMQ WCF綁定的雙工或請求-答復配置問題

[英]Duplex or request-reply with Apache ActiveMQ WCF Binding configuration question

我正在嘗試為WCF應用程序使用Apache.NMS.WCF綁定,並收到以下錯誤-

合同要求使用TwoWay(請求-答復或雙工),但是綁定“ NmsBinding”不支持它,或者沒有正確配置為支持它。

我的system.service模型看起來像這樣-

    <bindings>
        <nmsBinding>
            <binding 
                name="myNMSBinding" 
                destination="test.queue" 
                destinationType="TemporaryQueue"
                >
            </binding>
        </nmsBinding>
    </bindings>

    <extensions>
        <!--<bindingElementExtensions>
            <add name="nmsTransPort" 
                 type="Apache.NMS.WCF.NmsTransportElement, Apache.NMS.WCF, Version=1.1.0.1642, Culture=neutral, PublicKeyToken=82756feee3957618" />
        </bindingElementExtensions>-->
        <bindingExtensions>
            <add name="nmsBinding" 
                 type="Apache.NMS.WCF.NmsBindingCollection, Apache.NMS.WCF, Version=1.1.0.1642, Culture=neutral, PublicKeyToken=82756feee3957618" 

                 />
        </bindingExtensions>
    </extensions>

    <services>
        <service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
            <!-- Service Endpoints -->
            <endpoint 
                address="tcp://localhost:61616" 
                binding="nmsBinding" 
                bindingConfiguration="myNMSBinding" 
                contract="WcfService1.IService1"
                />
        </service>
    </services>

有沒有一種方法可以將Apache NMS配置為雙工還是不支持雙工?

像ActiveMQ這樣的消息隊列通常在設計上通常是單向的-您可以將消息放入其中,僅此而已。

如果您確實需要回復,則真正的解決方案是反轉角色:您在主合同(單向)上向其發送消息的服務將成為客戶端,該客戶端將在第二個隊列上向您發送響應,在該隊列上您的應用正在作為服務器監聽。

請參閱有關主題的一些MSDN文檔和其他資源:

這些示例通常使用MSMQ,因為WCF本身就支持MSMQ,但是將任務分解為兩個單獨的單向合同的基本原理以及如何設置和使用兩個單獨的請求和響應隊列的基本原理也應適用於ActiveMQ。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM