【问题标题】:WSO2 Message Broker on-demand message consumtion from WSO2 ESB来自 WSO2 ESB 的 WSO2 Message Broker 按需消息消费
【发布时间】:2013-04-01 00:45:54
【问题描述】:

我正在尝试使用 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

最好的问候, 弗拉基米尔。

【问题讨论】:

    标签: wso2 wso2esb


    【解决方案1】:

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

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

    【讨论】:

    • 是的,我也读过那篇文章,但它似乎没有涵盖我们都坚持的场景。当您需要在请求期间创建动态队列时,创建消息存储也不是很灵活。我正在考虑使用他们的 RESTful API 切换到 JBoss HornetQ 作为 JMS 提供者:docs.jboss.org/hornetq/2.3.0.CR2/docs/user-manual/html/…
    【解决方案2】:

    首先您需要将消息保存在队列中

    <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>
    

    你可以使用这个代理服务来消费你用来保存消息的队列

    【讨论】:

      【解决方案3】:

      嗯,这更像是一个自定义要求。您可以使用自定义类中介器或连接器来实​​现此目的。 [1]

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-10-26
        • 2016-03-06
        • 2015-08-15
        • 2017-01-11
        • 1970-01-01
        • 1970-01-01
        • 2013-06-22
        相关资源
        最近更新 更多