2012-12-20 29 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/我们每个月都有新的章节出现。 –