Are your producers setting the JMSExpiration header? That's the only way the expiration period will have any effect, and that's the best way to do what you're looking for. Purging will delete the messages from offline durable subscribers, but it'll also delete any messages that your online ones just haven't gotten to yet, so it's a bit heavy-handed.
Tim On Jan 27, 2016 3:54 AM, "Joseph Chivers" <joseph.chiv...@siemens.com> wrote: > Is it possible to configure ActiveMQ (5.8) to purge old messages (messages > that have timed out (ttl) or have been consumed by all subscribers that > were > active when a message was posted) from a topic? > > We are having an issue where ActiveMQ jams from storing too much data > either > in cache or in the db. > > I have already set: > expireMessagesPeriod="30000" gcInactiveDestinations="true" > inactiveTimoutBeforeGC="30000" > on all topics in the policyEntry and that works well if there are no active > subscribers but there doesn't appear to be a way of simply removing > redundant messages from a topic with active subscribers. > > I have also set: > offlineDurableSubscriberTimeout="120000" > offlineDurableSubscriberTaskSchedule="30000" > schedulePeriodForDestinationPurge="10000" > on the broker to force removal of inactive subscribers. > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Configuring-topics-to-purge-old-messages-while-subscribers-are-active-tp4706489.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >