0

当涉及到 ActiveMQ 时,我遇到了问题。我需要知道我可以在哪里重新配置 Active MQ 以避免以下错误:

Usage Manager Memory Limit (67108864) reached on queue://1000010. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. 

请注意,我在 Ubuntu 11.10 上使用 ActiveMQ 5.5 版。

她是我的配置:

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

      <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.base}/conf/credentials.properties</value>
        </property>      
    </bean>

    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true"  schedulePeriodForDestinationPurge="0">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" producerFlowControl="false">
                  <pendingSubscriberPolicy>
                    <vmCursor />
                  </pendingSubscriberPolicy>
                </policyEntry>
                <policyEntry queue=">" producerFlowControl="false" maxPageSize="500" queuePrefetch="300" expireMessagesPeriod="0" queuePrefetch="1">

                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy> 

        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <persistenceAdapter persistent="true" useShutdownHook="false">
            <kahaDB directory="${activemq.base}/data/kahadb" journalMaxFileLength="32mb"/>
        </persistenceAdapter>

        <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage limit="1 gb"/>
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="1 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
        </transportConnectors>

    </broker>

    <import resource="jetty.xml"/>

</beans>
4

1 回答 1

1

您所看到的与将非持久消息发送到队列中是一致的。这看起来像您正在达到默认内存限制。如果您将持久消息发送到队列中,它们将使用 KahaDB,storeUsage因此100gb.

顺便说一句,您为所有队列queuePrefetch设置了两个值policyEntry- 这可能不是您想要的。

于 2013-05-23T08:09:37.743 回答