ActiveMQ连接数过多,导致ActiveMQ无法正常接入数据

ActiveMQ跑了一段时间,会出现连接数据过多的报错

Could not accept connection  : org.apache.activemq.transport.tcp.ExceededMaximumConnectionsException: Exceeded the maximum number of allowed client connections. See the 'maximumConnections' property on the TCP transport configuration URI in the ActiveMQ configuration file (e.g., activemq.xml) | org.apache.activemq.broker.TransportConnector | ActiveMQ Transport Server Thread Handler: tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600

解决方法

activemq.xml配置如下:
节点上新增:

broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000">
 
 
    
       
          
             
          
       
    
        
  

schedulePeriodForDestinationPurge:10000  每十秒检查一次,默认为0,此功能关闭
gcInactiveDestinations: true  删除掉不活动队列,默认为false
inactiveTimoutBeforeGC:30000 不活动30秒后删除,默认为60秒

你可能感兴趣的:(linux)