2013-04-09 110 views
0

我試圖使用ESB和Message Broker來設置以下場景。WSO2 Message Broker來自WSO2的消息點消息ESB

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

最好的問候, 弗拉基米爾。

回答

0

您可以參考這個網址:http://wso2.org/library/articles/2013/03/configuring-wso2-esb-wso2-message-broker

我也擊中流量2.我無法通過我的代理

+0

是的,我讀過那篇文章太多,但它似乎並沒有覆蓋場景中,我們既堅持了。同時創建一個消息存儲庫並不是非常靈活,當你需要說請求時創建一個動態隊列。我正在考慮使用他們的RESTful API作爲JMS提供者切換到JBoss HornetQ:http://docs.jboss.org/hornetq/2.3.0.CR2/docs/user-manual/html/rest.html – 2013-04-18 11:36:08

0

首先要得到mesaagebroker數據需要保存你的消息隊列

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

你可以使用這個代理服務消費隊列您用來保存消息