I just got a pretty interesting observation: I just tried my own tweaked
PendingDurableSubscriberPolicy (as I learned from the other thread, see
below) to the test code I've been using: 

http://activemq.2283324.n4.nabble.com/How-to-configure-this-combination-of-queue-cursors-tt4670003.html#a4670027

Then, the test code went through:  MemoryLimitTest.java
<http://activemq.2283324.n4.nabble.com/file/n4670029/MemoryLimitTest.java>  

-----

Let's explain what's happened again in the test code above, shortly.  With
only durable subscriber with prefetchSize=0, persistent message publishing
to the topic is blocked (PFC) by hitting per-destination memory limit (1MB). 
But, when I changed the PendingDurableSubscriberPolicy from the default
"StorePendingDurableSubscriberMessageStoragePolicy" to the customized one
(see below), persistent message publishing didn't get stuck by any PFC but
went through very well.


        // This makes the test flow through!
        // Without this (with default
StorePendingDurableSubscriberMessageStoragePolicy),
        // persistent message publishing to the topic got stuck. Why??
        policyEntry.setPendingDurableSubscriberPolicy(new
StorePendingDurableSubscriberMessageStoragePolicy() {
            @Override
            public PendingMessageCursor
getSubscriberPendingMessageCursor(Broker broker, String clientId, String
name,
                    int maxBatchSize, DurableTopicSubscription sub) {
                broker.getBrokerService().setPersistent(false);
                StoreDurableSubscriberCursor cursor =
(StoreDurableSubscriberCursor) super
                        .getSubscriberPendingMessageCursor(broker, clientId,
name, maxBatchSize, sub);
                broker.getBrokerService().setPersistent(true);
                return cursor;
            }
        });


I'm curious what difference is there between these two
"PendingDurableSubscriberPolicy"s particularly for the persistent pending
cursor used inside..  Strange..





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/cursor-memory-usage-limit-vs-memory-usage-limit-tp4669679p4670029.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to