activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yesnid <ns...@pelco.com>
Subject Re: Queue PolicyEntry Eviction Not working
Date Mon, 13 Apr 2009 23:01:59 GMT

Hello,

All I did was take the examples from the link I posted, and place them into
the default activeMQ configuration file: (see below)

I have tried this with a TTL of 0 essentially infinite for the message and
for non-zero values, but neither yielded any results for me. Also My queue
that I am trying to evict from has no consumer on it, does that make a
difference, I am beginning to suspect from other posts that it is? 

Could you post a configuration that has worked and I could try this and see
if I get better results with eviction?

Thank you,



<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<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   
  http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

    <!-- Allows us to use system properties as variables in this
configuration file -->
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

	<!-- Add this Attribute to the Broker element to get a clean broker set up
during testing & debugging: deleteAllMessagesOnStartup="true" -->

	<!--  -->
    <broker xmlns="http://activemq.apache.org/schema/core"
dataDirectory="${activemq.base}/data"  deleteAllMessagesOnStartup="true"  >

        <!-- Destination specific policies using destination names or
wildcards -->
        <destinationPolicy>
            <policyMap>
                <policyEntries>
                    <policyEntry queue=">" memoryLimit="5mb" 
advisoryForSlowConsumers="true" advisoryWhenFull="true"
sendAdvisoryIfNoConsumers="true" >
				<messageEvictionStrategy>
			            <oldestMessageEvictionStrategy/>
			      </messageEvictionStrategy> 
<!--

				<pendingMessageLimitStrategy> 
					<constantPendingMessageLimitStrategy limit="50" />
				</pendingMessageLimitStrategy> 
-->      
<pendingMessageLimitStrategy> 
<prefetchRatePendingMessageLimitStrategy multiplier="1"/>
</pendingMessageLimitStrategy> 
			  </policyEntry>
   	           <policyEntry topic=">" memoryLimit="5mb">
                        <dispatchPolicy>
                            <strictOrderDispatchPolicy/>
                        </dispatchPolicy>
                        <subscriptionRecoveryPolicy>
                            <lastImageSubscriptionRecoveryPolicy/>
                        </subscriptionRecoveryPolicy>
                    </policyEntry>
                </policyEntries>
            </policyMap>
        </destinationPolicy>

        <!-- Use the following to configure how ActiveMQ is exposed in JMX
-->
        <managementContext>
            <managementContext createConnector="true"/>
        </managementContext>

        <!-- The store and forward broker networks ActiveMQ will listen to
-->
        <networkConnectors>
            <!-- by default just auto discover the other brokers -->
            <!-- <networkConnector name="default-nc"
uri="multicast://default"/> -->
            <!-- Example of a static configuration:
            <networkConnector name="host1 and host2"
uri="static://(tcp://10.220.196.152:61616)"/>
            -->
        </networkConnectors>

        <persistenceAdapter>
            <amqPersistenceAdapter syncOnWrite="false"
directory="${activemq.base}/data" maxFileLength="20 mb"/>
        </persistenceAdapter>

        <!--  The maximum about of space the broker will use before slowing
down producers -->
        <systemUsage>
            <systemUsage>
                <memoryUsage>
                	<!-- MemoryUsage is the maximum amount of memory the broker
will use -->
                    <memoryUsage limit="20 mb"/>
                </memoryUsage>
                <storeUsage>
                	<!-- Store usage controls the maximum size of the
AMQMessage Store  -->
                    <storeUsage limit="1 gb" name="foo"/>
                </storeUsage>
                <tempUsage>
                	<!-- TempUsage is the maximum size of the store used for
non-persistent  
                     messages that may optionally overflow from memory
awaiting dispatch -->
                    <tempUsage limit="100 mb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>


        <!-- The transport connectors ActiveMQ will listen to -->
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
		<!--
		-->
            <transportConnector name="ssl" uri="ssl://localhost:61617"/>
        </transportConnectors>

        <sslContext>
            <sslContext keyStore="file:${activemq.base}/conf/broker.ks"
keyStorePassword="password"
trustStore="file:${activemq.base}/conf/broker.ts"
trustStorePassword="password"/>
        </sslContext>

<!--
        <discoveryAgent>
            <zeroconfDiscovery type="_activemq.broker.development."/>
        </discoveryAgent>
-->

    </broker>

    <!-- An embedded servlet engine for serving up the Admin console -->
    <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
        <connectors>
            <nioConnector port="8161"/>
        </connectors>
        <handlers>
            <webAppContext contextPath="/admin"
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
            <webAppContext contextPath=""
resourceBase="${activemq.base}/webapps/demo" logUrlOnStart="true"/>
            <webAppContext contextPath="/fileserver"
resourceBase="${activemq.base}/webapps/fileserver" logUrlOnStart="true"/>
        </handlers>
    </jetty>

</beans>






jbekas wrote:
> 
> 
> yesnid wrote:
>> 
>> I am trying to get an eviction policy as described here:
>> 
>> http://activemq.apache.org/slow-consumer-handling.html
>> 
>> working for the Queues on my broker, I have attempted several
>> configurations of different types and don't seem to be having any luck
>> getting messages to expire is there something I am missing please HELP!
>> 
> 
> Can you post a sample broker configuration that you think should work with
> the queue eviction policy?  Also, any relevant code for setting the TTL or
> JMSExpiration would be helpful as well.
> 
> I've been able to make the eviction policy work for queues, topics are a
> different story.
> 
> 

-- 
View this message in context: http://www.nabble.com/Queue-PolicyEntry-Eviction-Not-working-tp23026416p23030443.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message