2012-12-20 28 views
0

我有一個mule流,它接受一個xml並將它發佈到一個vm隊列名稱中作爲mule中的「mailQueue」。 XML輸入和騾子流量低於:從Mule的vm隊列發佈到REST端點

<Mail> 
    <Name>JonHender</Name> 
    <Age>16</Age> 
</Mail> 

Mule_config.xml:

<!-- This is the persistent VM connector --> 
      <vm:connector name="mailQueueConnector" queueTimeout="1000"> 
       <vm:queue-profile> 
       <file-queue-store /> 
       </vm:queue-profile> 
      </vm:connector> 


      <flow name="MailService"> 
       <https:inbound-endpoint address="https://localhost:71234/message/email" 
        method="POST" 
        exchange-pattern="request-response" 
        contentType="application/xml"/> 

       <vm:outbound-endpoint path="mailQueue" connector-ref="mailQueueConnector"> 
        <message-property-filter pattern="http.status=200" /> 
        <logger message="INTO mailQueue" level="INFO"/> 
       </vm:outbound-endpoint> 

      </flow> 

現在,我必須從這個 「mailQueue」 閱讀和張貼到REST終點( HTTPS://本地主機:71234 /消息/ sendemail)。我試圖通過在相同的流量增加這一點,但沒有奏效

<inbound> 
    <vm:inbound-endpoint address="vm://emailBufferQueue" exchange-pattern="one-way" connector-ref="emailQueueConnector" /> 
</inbound> 
<outbound> 
    <https:outbound-endpoint address="https://localhost:71234/messages/sendemail" 
</outbound> 

如何從虛擬機隊列中讀取並張貼到REST終點?我可以在iam寫入隊列的同一個流程中完成它,還是應該創建一個新的流程?有人可以讓我看看流程,並將其發送到Rest端點嗎?

先感謝和聖誕快樂你們都

+0

嘿大衛......我不是完全地熟悉這個論壇的規則。這是我的不好,下次會記住它。感謝您指出這一點 – user1717230

回答

2

消耗mailQueue在另一個流程:

<flow name="MailSender"> 
    <vm:inbound-endpoint path="mailQueue" 
         exchange-pattern="one-way" 
         connector-ref="mailQueueConnector" /> 
    <https:outbound-endpoint 
      address="https://#[message.inboundProperties.username]:#[message.inboundProperties.password]@localhost:71234/messages/sendemail" /> 
</flow> 
+0

謝謝大衛....我可以測試後,讓你知道.. – user1717230

+0

順便說一句,我開始閱讀你的「騾子在行動」書昨天。迄今爲止的好書...如果有更新的版本出現,那麼任何想法? – user1717230

+0

謝謝。我希望你買了第二版(涵蓋Mule 3):http://manning.com/dossot2/我們每個月都有新的章節出現。 –