You're right that the units for that parameter are milliseconds. But I think you've misunderstood what it does; that setting specifies how often the broker should look for messages whose expiration date has arrived, and process them (e.g. by moving them to the DLQ), but the messages have to have already been given a timeout at which they'll expire. I use Camel to send my messages, and there's a URI option that Camel provides to set the timeout, but there's definitely a call within the ActiveMQ API to do it. I can't tell you what it is since I haven't needed it, but Google should turn it up for you easily enough.
On Wed, Sep 24, 2014 at 3:50 PM, jeffrey <jeffreyhasm...@hotmail.com> wrote: > In our activemq.xml file, simplified a little bit: > > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:amq="http://activemq.apache.org/sch > ema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.sprin > gframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd http:// > activemq.apache.org/schema/core > http://activemq.apache.org/schema/core/activemq-core.xsd"> > <bean > > class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> > </bean> > <bean id="logQuery" > class="org.fusesource.insight.log.log4j.Log4jLogQuery" > lazy-init="false" scope > ="singleton" init-method="start" destroy-method="stop"> > </bean> > <broker xmlns="http://activemq.apache.org/schema/core" > brokerName="testname" dataDirectory="${activemq.data}"> > <managementContext> > <managementContext createConnector="false"/> > </managementContext> > <persistenceAdapter> > <kahaDB directory="${activemq.data}/kahadb"/> > </persistenceAdapter> > <systemUsage> > <systemUsage> > <memoryUsage> > <memoryUsage percentOfJvmHeap="70"/> > </memoryUsage> > <storeUsage> > <storeUsage limit="1 gb"/> > </storeUsage> > <tempUsage> > <tempUsage limit="500 mb"/> > </tempUsage> > </systemUsage> > </systemUsage> > <sslContext> > <sslContext keyStore="/etc/BROKER.jks" keyStorePassword="xxx" > trustStore="/etc/BROKERTRUST.jks" trustStorePassword="xxx"/> > </sslContext> > <transportConnectors> > <transportConnector name="ssl" > > uri="ssl://hostname:61616?needClientAuth=true&maximumConnections=1000&wireFormat.maxFrameSize=104857600"/> > </transportConnectors> > <shutdownHooks> > <bean xmlns="http://www.springframework.org/schema/beans" > class="org.apache.activemq.hooks.SpringContextHook"/> > </shutdownHooks> > <plugins> > <jaasCertificateAuthenticationPlugin configuration="CertLogin"/> > <authorizationPlugin> > <map> > <authorizationMap> > <authorizationEntries> > <authorizationEntry topic="ActiveMQ.Advisory.>" read="*" > write="*" admin="*"/> > <authorizationEntry queue="events" reader="read" > admin="writer" write="writer"/> > </authorizationEntries> > </authorizationMap> > </map> > </authorizationPlugin> > </plugins> > <destinationPolicy> > <policyMap> > <policyEntries> > <policyEntry queue="events" expireMessagesPeriod="10000"/> > </policyEntries> > </policyMap> > </destinationPolicy> > </broker> > </beans> > > At the bottom, we have this expireMessagesPeriod, which I assume should be > in milliseconds, I cannot find this properly stated anywhere. > But I am writing to this queue, and if no one receives the message within > 10 > seconds, I am expecting it to expire and be deleted from the broker. This > functionality does not seem to be working at all, even reducing the time to > 1 has no effect. When the receiver program reconnects, it receives all the > messages that should have expired. > > Is there something I am missing in the xml to enable this feature, or > something I could be doing in my sending client to cause this? I am using > ActiveMQ 5.9, both Java and C++ APIs. But in this scenario I am sending > with > Java and receiving with C++. > > Thanks > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/expireMessagesPeriod-for-activemq-broker-tp4685839.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >