9

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

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.

<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!

BurnetZhong
  • 438
  • 1
  • 5
  • 14

3 Answers3

13

In your activeMQ.xml you would have some configuration like this

<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

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

Hope this helps!

Good luck!

Vihar
  • 3,626
  • 2
  • 24
  • 47
  • 3
    Thanks for help. But I don't have this config file in my web app, should I create one? Will ActiveMQ read it automatically? – BurnetZhong Dec 18 '14 at 15:13
  • The file will be present where your activemq instance is running i.e the place where you are connecting to your broker i. e your {broker_url} if you show us that URL we can point it out – Vihar Dec 18 '14 at 15:47
  • Thanks again. My ActiveMQ is hosted in the same machine, so it is localhost. – BurnetZhong Dec 18 '14 at 16:51
  • I hope you know where your activemq directory is, else find activemq.xml file in your system – Vihar Dec 18 '14 at 17:05
  • did you Get the file? – Vihar Dec 20 '14 at 15:52
  • Sorry for late reply. I am wondering, this error message is reported from my Web app, and my web app is the client of ActiveMQ. If I understand correctly, this error message should be reported by ActiveMQ server. – BurnetZhong Dec 22 '14 at 09:43
  • 1
    but as you point out in question heading ,you have a embedded activeMQ, so I guess it will be starting when you run your web app – Vihar Dec 22 '14 at 12:21
5

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

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

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

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/core http://activemq.apache.org/schema/core/activemq-core.xsd)

Community
  • 1
  • 1
Robert
  • 230
  • 2
  • 9
0

If you use a Spring application with an embedded ActiveMQ broker, you can specify a custom activemq.xml as explained in :How to specify a custom activemq.xml with a Spring embedded ActiveMQ broker?

You can then adapt the tempUsage value to your environment:

<systemUsage>
  <systemUsage>
    <memoryUsage>
      <memoryUsage percentOfJvmHeap="70"/>
    </memoryUsage>
    <storeUsage>
      <storeUsage limit="100 gb"/>
    </storeUsage>
    <tempUsage>
      <tempUsage limit="1 gb"/>
    </tempUsage>
  </systemUsage>
</systemUsage>
Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240