0

我有一个 mule 流,它接受一个 xml 并将其发布到一个 vm 队列名称作为 mule 中的“mailQueue”。xml 输入和 mule 流程如下:

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

骡子配置.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://localhost:71234/messages/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>

如何从 vm 队列中读取并将其发布到 REST 端点?我可以在我写入队列的同一流程中执行此操作,还是应该创建一个新流程?有人可以向我展示从 the 读取并将其发送到 Rest 端点的流程吗?

提前谢谢大家,圣诞快乐

4

1 回答 1

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>
于 2012-12-20T22:49:27.823 回答