<transportConnectors> <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --> <transportConnectorname="openwire"uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="amqp"uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="stomp"uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="mqtt"uri="mqtt://0.0.0.0:1883?maximumConnections=100000&wireFormat.maxFrameSize=104857600"/> <transportConnectorname="ws"uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> </transportConnectors>
如果超出最大连接限制,会提示以下错误!
1 2 3 4 5
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) at org.apache.activemq.transport.tcp.TcpTransportServer.doHandleSocket(TcpTransportServer.java:582)[activemq-client-5.15.6.jar:5.15.6] at org.apache.activemq.transport.tcp.TcpTransportServer.handleSocket(TcpTransportServer.java:571)[activemq-client-5.15.6.jar:5.15.6] at org.apache.activemq.transport.tcp.TcpTransportServer$1.run(TcpTransportServer.java:497)[activemq-client-5.15.6.jar:5.15.6] at java.lang.Thread.run(Thread.java:748)[:1.8.0_181]