java 嵌入式 ActiveMQ 的启动错误:临时存储限制为 51200 mb

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27546730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 11:58:11  来源:igfitidea点击:

Startup error of embedded ActiveMQ: Temporary Store limit is 51200 mb

javaspringactivemq

提问by BurnetZhong

I have a Spring web application which will send and listen on a standalone ActiveMQ. When I start the web application, it shows:

我有一个 Spring Web 应用程序,它将在独立的 ActiveMQ 上发送和侦听。当我启动 Web 应用程序时,它显示:

20:12:52.684 [localhost-startStop-1] ERROR o.a.activemq.broker.BrokerService - Temporary Store limit is 51200 mb, whilst the temporary data directory: /root/activemq-data/localhost/tmp_storage only has 29021 mb of usable space

I googled and read many articles, they all refer to configure broker and systemusage to limit the temp store size. However, I do not how to do this in Spring configuration. Below is my configuration XML.

我在谷歌上搜索并阅读了很多文章,它们都提到配置代理和系统使用来限制临时存储的大小。但是,我不知道如何在 Spring 配置中执行此操作。下面是我的配置 XML。

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${jms.broker_url}" />
</bean>
<bean id="cachingConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory" ref="connectionFactory" />
    <property name="sessionCacheSize" value="10" />
</bean>

<bean id="recvQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value="q.recv" />
</bean>
<bean id="sendQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value="q.send" />
</bean>
<bean id="notifyQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg value="q.notify" />
</bean>

<!-- Spring JMS Template -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="cachingConnectionFactory" />
</bean>
<bean id="batchImplMessageProducer" class="com.seebon.spfcore.repository.jms.BatchImplMessageProducer">
    <property name="jmsTemplate" ref="jmsTemplate" />
    <property name="sendQueue" ref="sendQueue" />
    <property name="recvQueue" ref="recvQueue" />
    <property name="notifyQueue" ref="sendQueue" />

</bean>

<bean id="advancedQueueContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="destination" ref="recvQueue" />
    <property name="messageListener" ref="recvBatchImplMessageListener" />

    <property name="concurrentConsumers" value="5" />
    <property name="maxConcurrentConsumers" value="10" />
</bean>


<bean id="recvBatchImplMessageListener" class="com.seebon.spfcore.repository.jms.RecvBatchImpMessageListener" />

Please help me out of here, THANKS!

请帮我离开这里,谢谢!

回答by Vihar

In your activeMQ.xmlyou would have some configuration like this

在你的activeMQ.xml你会有一些这样的配置

<systemUsage>
   <systemUsage>
      ....
      <tempUsage>
         <tempUsage limit="50 gb"/>
      </tempUsage>
   </systemUsage>
</systemUsage>

you need to specify a value which is available on your disk,as error clearly mentions there is only 29021 MB of free space you need to set <tempUsage limit="50 gb"/>to a value lesser than your free space

您需要指定磁盘上可用的值,因为错误明确提到只有 29021 MB 的可用空间,您需要将其设置 <tempUsage limit="50 gb"/>为小于可用空间的值

you can do something like <tempUsage limit="20 gb"/>

你可以做类似的事情 <tempUsage limit="20 gb"/>

Hope this helps!

希望这可以帮助!

Good luck!

祝你好运!

回答by Robert

I had the same problem, but placing an activeMQ.xml somewhere on the server isn't the best idea in this case, I think.

我遇到了同样的问题,但我认为在这种情况下,将 activeMQ.xml 放在服务器上的某处并不是最好的主意。

When I use an embedded active mq server, I want to keep all configuration in one place (especially in my project/war file).

当我使用嵌入式活动 mq 服务器时,我想将所有配置保存在一个地方(尤其是在我的项目/war 文件中)。

Now it is possible to set the tempUsage config values directly at broker-bean definition: as described in this link.

现在可以直接在 broker-bean 定义中设置 tempUsage 配置值:如此链接中所述

For example:

例如:

<amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
        <amq:transportConnector uri="tcp://localhost:0"/>
    </amq:transportConnectors>
    <amq:systemUsage>
        <amq:systemUsage>
            <amq:memoryUsage>
                <amq:memoryUsage limit="64 mb"/>
            </amq:memoryUsage>
            <amq:storeUsage>
                <amq:storeUsage limit="512 mb"/>
            </amq:storeUsage>
            <amq:tempUsage>
                <amq:tempUsage limit="128 mb"/>
            </amq:tempUsage>
        </amq:systemUsage>
    </amq:systemUsage>
</amq:broker>

(amq - namespace = http://activemq.apache.org/schema/corehttp://activemq.apache.org/schema/core/activemq-core.xsd)

(amq - 命名空间 = http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd