0

ESB と Message Broker を使用して、次のシナリオをセットアップしようとしています。

フロー 1:

Client 1 Sends the message to ESB -> ESB consumes the message and stores it into the queue -> End of flow 1;

フロー 2:

Client 2 sends a request to ESB to get messages -> ESB gets the messages from the queue defined for Client 2 -> ESB sends back a pack of message that were present in the queue

フロー 1 を実装するのに問題はありませんが、ドキュメントと例はストア アンド フォワード パターンを参照しているため、クライアントの要求に応じてメッセージを消費する実際の例は見当たりませんでした。「ストア アンド プル」モデルです。

誰でもアドバイスしてもらえますか?

参照リンク: http://docs.wso2.org/wiki/display/ESB460/Sample+702%3A+Introduction+to+Message+Forwarding+Processor

http://docs.wso2.org/wiki/display/MB201/Integrating+WSO2+ESB

よろしく、ウラジミール。

4

3 に答える 3

0

まず、メッセージをキューに保存する必要があります

<address uri="jms:/Queue1?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:5672&amp;transport.jms.DestinationType=queue&amp;java.naming.provider.url=repository/conf/jndi.properties" statistics="disable"/>

ここで説明されているように、repository/conf/jndi.properties でキュー名を指定する必要があります http://docs.wso2.org/wiki/display/MB201/Integrating+WSO2+ESB

次に、JMS キューと同じ名前のプロキシを定義して、そのキューを消費できます。

<proxy xmlns="http://ws.apache.org/ns/synapse" name="Queue1" transports="jms" startOnLoad="true" trace="disable" statistics="disable">
    <target inSequence="your_in_sequence" outSequence="your_out_sequence" faultSequence="your_fault_sequence"/>
    <parameter name="transport.jms.ContentType">
        <rules>
            <jmsProperty>contentType</jmsProperty>
            <default>application/xml</default>
        </rules>
    </parameter>
</proxy>

このプロキシ サービスを使用して、メッセージの保存に使用したキューを消費できます

于 2013-06-18T09:25:20.160 に答える
0

まあ、これはカスタム要件のようなものです。これは、カスタム クラス メディエーターまたはコネクタを使用して実現できます。[1]

[1] https://docs.wso2.com/display/ESB481/Creating+a+Connector

于 2015-07-30T10:52:35.460 に答える