activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Tran <dant...@gmail.com>
Subject Re: Expired message - does it work?
Date Sat, 17 Oct 2009 05:14:12 GMT


scratch that,  i need jmsTemplate.setExplicitQosEnabled( true ); as well

sorry for the noise.

-D


Dan Tran wrote:
> 
> 
> I would like to bring discussion back where I cannot get message in my
> queue to expire.
> 
> I am using JmsTemplate producer to send messages to the queue with no
> consumer ( intended),  here is the snippet
> 
>     @Resource
>     private JmsTemplate jmsTemplate;
>     
>     @PostConstruct
>     public void afterPropertiesSet()
>     {
>         jmsTemplate.setDeliveryMode( DeliveryMode.NON_PERSISTENT );
>         jmsTemplate.setTimeToLive( messageTimeToLive );
>     }
> 
> However the messages ( found in Jconsole) stay in to queue with delivery
> mode set to PERSISTENT and expired time set to 0. It seems my setup has no
> affect
> 
> 
> Is it the right way?
> 
> -Dan
> 
> 
> 
> Dan Tran wrote:
>> 
>> 
>> It turns out I am using topic and when my consumer is destroyed, all
>> messages also destroyed, but the stats still lingering in the jconsole
>> and this is were confusion starts.
>> 
>> thanks
>> 
>> -Dan
>> 
>> 
>> Dan Tran wrote:
>>> 
>>> 
>>> Hi Felix,
>>> 
>>> Thanks for the info, both of my producer and consumer's clocks are
>>> synced. 
>>> 
>>> To stop the message transfer from producer to consumer, I send a control
>>> message to produce trigger it to stop and then shutdown the consumer
>>> listener.  That is why we can see some messages left on the queue
>>> 
>>> thanks
>>> 
>>> -Dan
>>> 
>>> 
>>> fehm wrote:
>>>> 
>>>> Hi Dan,
>>>> 
>>>> If you play with message expiration make sure that your
>>>> consumer/broker/producer have the same time since the TimeTtoLive of
>>>> the message is set relative to your producer. If you broker is in the
>>>> future relative to your producer and the gap is greater than your TTL
>>>> you won't see any messages on the consumer.
>>>> 
>>>> How exactly do you "stop" you consumer ?
>>>> Remember that a the dequeue counter only increase if message has been
>>>> acknowledged by the consumer. Inflight again means that this number of
>>>> messages have not (yet) been acknowledged by the consumer.
>>>> Can it be that the consumer received the message but couldn't ack the
>>>> 13 messages since you stopped it ?
>>>> 
>>>> 
>>>> Cheers,
>>>> Felix
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Dan Tran wrote:
>>>>> 
>>>>> 
>>>>> Hi,  I am testing 5.3-SNAPSHOT to pick up expired message enhancement
>>>>> where the message will be automatically removed when timed out.
>>>>> 
>>>>> I have multiple topics with each has a pair of producer/consumer.  All
>>>>> messages are memory base, where 'memoryUsage' is used to do the
>>>>> producer flow control. All producer messages are set to have time to
>>>>> live value.  However, when I stop both producer and consumer during a
>>>>> heavy producer to consumer communication.  Some messages are left in
>>>>> the queue.  The jconsole shows the expiredCount only set at 0 after
>>>>> waiting for time to expired.
>>>>> 
>>>>> Here is some stats at my topic.
>>>>> 
>>>>> enqueueCount=21699
>>>>> dispatchCount=31698
>>>>> dequeueCount=21685
>>>>> inFlightCount=13
>>>>> expriredCount=0
>>>>> 
>>>>> consumerCount=0
>>>>> producerCount=0  ( still alive but does nothing )
>>>>> 
>>>>> queueSize=21699
>>>>> 
>>>>> here is my broker configuration
>>>>> 
>>>>>   <amq:broker useJmx="true" persistent="false"
>>>>> advisorySupport="false">
>>>>> 
>>>>>     <!-- Destination specific policies using destination names or
>>>>> wildcards -->
>>>>> 
>>>>>     <amq:destinationPolicy>
>>>>>       <amq:policyMap>
>>>>>         <amq:policyEntries>
>>>>>           <amq:policyEntry topic=">"  producerFlowControl="true"
>>>>> memoryLimit="${fdb.broker.agent.memoryLimit} mb" />
>>>>>         </amq:policyEntries>
>>>>>       </amq:policyMap>
>>>>>     </amq:destinationPolicy>
>>>>> 
>>>>>     <amq:sslContext>
>>>>>       <amq:sslContext
>>>>> keyStore="file:${FORTIDB_HOME}/conf/.jmsBrokerKeyStore"
>>>>> keyStorePassword="${fdb.broker.keyStorePassword}" />
>>>>>     </amq:sslContext>
>>>>> 
>>>>>     <!--  The maximum about of space the broker will use before
>>>>> slowing down producers -->
>>>>>     <amq:systemUsage>
>>>>>       <amq:systemUsage>
>>>>>         <amq:memoryUsage>
>>>>>           <amq:memoryUsage limit="${fdb.broker.memoryUsage} mb" />
>>>>>         </amq:memoryUsage>
>>>>>       </amq:systemUsage>
>>>>>     </amq:systemUsage>
>>>>>     
>>>>>     <amq:transportConnectors>
>>>>>       <amq:transportConnector
>>>>> uri="${fdb.broker.protocol}://0.0.0.0:${fdb.broker.port}" />
>>>>>     </amq:transportConnectors>
>>>>> 
>>>>> 
>>>>>   </amq:broker>
>>>>> 
>>>>> 
>>>>> Any helps and suggestion are greatly appreciated.
>>>>> 
>>>>> -Dan
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Expired-message---does-it-work--tp25645401p25935492.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message