0

我正在尝试使用 ESB 和 Message Broker 设置以下场景。

流程一:

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

可以参考这个网址:http ://wso2.org/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker

我也对 Flow 2 感到震惊。我无法通过我的代理从 mesaagebroker 获取数据

于 2013-04-17T11:15:47.447 回答
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"/>

您需要在存储库/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 回答