Mule ESB+RabbitMQ可靠性和运行时间:如何在运行时自动重新创建已删除的交换



我有一个大型mule应用程序,它在多个队列上接收并发布到至少一个交换机。我正在通过删除队列和交换机手动对应用程序进行QA'ing,看看mule是否会重试连接(并完全关闭rabbit)

此问题适用于何时删除交换。消息进入一个锁定的匿名队列,该队列名为:amq.gen-gFs6-7sP2nw1ntgobO6cBg

我正在寻找一种方法来重新连接交换机,并且仍然可以传递消息。这可能吗?

我设置了如下选项exchangeDurable="true"queueDurable="true"

还有什么其他事情(或兔子配置)需要我做或对我有益吗?

下一个测试:在处理过程中关闭RabbitMQ。

代码:

<mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core" 
xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" 
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.2" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" 
xmlns:file="http://www.mulesoft.org/schema/mule/file" 
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd"
xmlns:context="http://www.springframework.org/schema/context">
<amqp:connector name="amqpAutoAckLocalhostConnector"
      host="${config.status_reporting.host}"
      port="${config.status_reporting.port}"
      virtualHost="${config.status_reporting.virtual_host}"
      username="${config.status_reporting.username}"
      password="${config.status_reporting.password}"
      requestedHeartbeat="${config.status_reporting.requestedHeartbeat}"
      doc:name="AMQP Connector for Status Messages"/>

<flow name="send_status" doc:name="send_status">        
    <vm:inbound-endpoint path="send_status" exchange-pattern="one-way" responseTimeout="10000" doc:name="VM" />
    <logger message="starting send status" level="DEBUG" doc:name="Logger"/>
    <!-- some code here has been removed for stackoverflow question --> 
    <flow-ref name="cwm_send" doc:name="flow ref"/>
</flow>

<flow name="cwm_send" doc:name="cwm_send">
    <amqp:outbound-endpoint exchangeName="${config.status_reporting.exchange_name}"
                      exchangeType="topic"                        
                      exchangeDurable="${config.status_reporting.exchange_is_durable}"
                      routingKey="${config.status_reporting.routing_key}"
                      connector-ref="amqpAutoAckLocalhostConnector" doc:name="AMQP Out" queueDurable="true" responseTimeout="10000"/>          
</flow>

<flow name="send_ingest_status" doc:name="send_ingest_status">
    <vm:inbound-endpoint exchange-pattern="request-response" responseTimeout="10000" doc:name="VM" path="send_ingest_status"/>
    <vm:outbound-endpoint path="send_status" exchange-pattern="one-way" doc:name="Send Status">
        <set-payload value="#[[
            'status_code': 'foo',
            'status_descr': 'test description.',
            'status_final': '0',    
            'version': '1.0']]"/>
    </vm:outbound-endpoint>
</flow>
</mule>

谢谢。

当仅在出站端点中声明交换时,似乎也会出现此问题。在Mulesoft JIRA中有一个关于这一点的公开错误,你可以投票支持它来帮助他们优先考虑它

我看了一下源代码,问题似乎是在启动出站端点时根本没有代码来声明交换。在您的情况下,您可能希望代码在发送消息时运行,或者在删除交换时运行。上述错误不会涵盖这个时间,但您可能会打开一个描述用例和所需功能的新问题。拉取请求可能会更好!;)

最新更新