微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

RabbitMQ仲裁队列段文件填满了磁盘空间

如何解决RabbitMQ仲裁队列段文件填满了磁盘空间

我们有一个问题,RabbitMQ正在用与仲裁队列相关的段文件填充磁盘空间。实际上我们没有集群(quorum_cluster_size = 1)

引起问题的队列来自通过Spring / RabbitMQ JMS连接到RabbitMQ服务器的客户端。 由于sessionTransacted为true,因此客户端接收到的消息将在收到消息后立即由autoAck确认,并且在完成消息处理后,便会提交事务。 即使队列上没有流量,RabbitMQ也会以相等的间隔保持写入段文件

客户端在Spring中配置:

<bean id="y_listenerContainerMedium" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="autoStartup" value="false"/>
    <property name="concurrentConsumers" value="1"/>
    <property name="connectionFactory" ref="jmsRmqConnectionFactory"/>
    <property name="destination" ref="y_queue_inbound_m"/>
    <property name="messageListener" ref="y_messageListener"/>
    <property name="sessionTransacted" value="true"/>       
</bean>

<bean id="y_queue_inbound_m" class="com.rabbitmq.jms.admin.RMQDestination" >
    <property name="destinationName" value="${y.jms.q.name.inbound.medium}" />
    <property name="amqp"            value="true" />
    <property name="amqpQueueName"   value="${y.jms.q.name.inbound.medium}" />
</bean>
  
<bean id="jmsRmqConnectionFactory" class="com.our.db.v2.jms.OurRMQConnectionFactory" >
    <property name="username" value="${username}" />
    <property name="password" value="${pw}" />
    <property name="virtualHost" value="${vhost}" />
    <property name="host" value="${host}" />
    <property name="port" value="5671" /> 
    <property name="tls" value="true" /> 
    <!--  DeadLetter Handling on the Queue -->
    <property name="requeueOnMessageListenerException" value="true" /> 
    <!-- Allow Message Processing upto 12h -->
    <property name="onMessageTimeoutMs" value="43200000" /> 
  </bean>

  public class OurRMQConnectionFactory extends RMQConnectionFactory {
    public void setTls(boolean tls) throws Exception{
        if(tls) {
            super.useSslProtocol(SSLContext.getDefault());
        }
    }
  }
  

客户:
Microsoft Windows Server 2012 R2
jdk1.8.0_202
spring-jms-4.3.20.RELEASE
rabbitmq-jms-2.1.1
amqp-client-5.9.0

服务器:
红帽企业Linux 7.8
RabbitMQ 3.8.8
erlang-23.0.3-1.el7

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。