gpt4 book ai didi

java - 从 Mule 中的虚拟机队列发布到 REST 端点

转载 作者:行者123 更新时间:2023-12-02 07:22:51 24 4
gpt4 key购买 nike

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

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

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

提前致谢,祝大家圣诞快乐

最佳答案

在另一个流程中使用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>

关于java - 从 Mule 中的虚拟机队列发布到 REST 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13981286/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com