In my experience, message expiration is only checked on the broker when
preparing to dispatch a message and in the consumer when preparing to
consume it. So what you're describing sounds like expected behavior, but
I'd expect all those messages to be expired when your consumer reconnects.

On Jul 20, 2017 7:05 AM, "jbar" <[email protected]> wrote:

> Hello,
>
> Messages from my queue (httpTestConn_notifications) won't get discarded. On
> a producer side, I've set a TTL of 2000 ms (with the setTimeToLive()
> method).
> Im using a 5.15 version of activemq (however I've tried to do that on 13.2
> as well) . Here's a part of my activemq.xml:
>
>  <broker xmlns="http://activemq.apache.org/schema/core";
> brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true"
> advisorySupport="false" persistent="false">
>
>         <destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry queue="*.prioritized"
> prioritizedMessages="true"
> useCache="false" expireMessagesPeriod="0" queuePrefetch="1"
> memoryLimit="10mb" producerFlowControl="true">
>                         <pendingQueuePolicy>
>                         <vmQueueCursor/>
>                     </pendingQueuePolicy>
>                 </policyEntry>
>                 <policyEntry queue="httpTestConn_notifications"
> expireMessagesPeriod="3000" memoryLimit="50mb" producerFlowControl="true">
>                         <pendingQueuePolicy>
>                         <vmQueueCursor/>
>                     </pendingQueuePolicy>
>                         <deadLetterStrategy>
>                         <sharedDeadLetterStrategy processExpired="false" />
>                         </deadLetterStrategy>
>                         </policyEntry>
>                 <policyEntry queue=">" expireMessagesPeriod="3000"
> memoryLimit="50mb"
> producerFlowControl="true">
>                         <pendingQueuePolicy>
>                         <vmQueueCursor/>
>                     </pendingQueuePolicy>
>                         <deadLetterStrategy>
>                         <sharedDeadLetterStrategy processExpired="false" />
>                         </deadLetterStrategy>
>                 </policyEntry>
>
>                 <policyEntry topic=">" >
>
>                   <pendingMessageLimitStrategy>
>                     <constantPendingMessageLimitStrategy limit="100"/>
>                   </pendingMessageLimitStrategy>
>                 </policyEntry>
>               </policyEntries>
>             </policyMap>
>         </destinationPolicy>
>
>
> When I disable the consumer to ensure that ttl will be reached, the message
> just stays pending/enqueued forever, and I want it to disappear.
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Messages-are-not-discarded-from-queue-when-
> they-re-expired-tp4728731.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Reply via email to