[ 
https://issues.apache.org/jira/browse/QPID-7618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818858#comment-15818858
 ] 

Rob Godfrey commented on QPID-7618:
-----------------------------------

The other issue here is that I don't think that the code above will actually 
remove the persistent record of the queue entry, only the in-memory copy

If we compare with what happens on tll expiry we see (in AbstractQueue.java)

{code}
boolean acquiredForDequeueing = node.acquireOrSteal(new Runnable()
                    {
                        @Override
                        public void run()
                        {
                            dequeueEntry(node);
                        }
                    });

                    if(acquiredForDequeueing)
                    {
                        _logger.debug("Dequeuing expired node {}", node);
                        // Then dequeue it.
                        dequeueEntry(node);
                    }
{code}

where dequeueEntry looks like:

{code}
    private void dequeueEntry(final QueueEntry node)
    {
        ServerTransaction txn = new 
AutoCommitTransaction(getVirtualHost().getMessageStore());
        dequeueEntry(node, txn);
    }

    private void dequeueEntry(final QueueEntry node, ServerTransaction txn)
    {
        txn.dequeue(node.getEnqueueRecord(),
                    new ServerTransaction.Action()
                    {

                        public void postCommit()
                        {
                            node.delete();
                        }

                        public void onRollback()
                        {

                        }
                    });
    }
{code}

the above code also copes with the case where the node in question is 
temporarily locked - it seems like the ring queue patch will just busy loop 
until it can acquire the oldest node on the queue... I'm not sure if that is 
the best strategy - although this may be a hard problem to solve.

> Ring policy type
> ----------------
>
>                 Key: QPID-7618
>                 URL: https://issues.apache.org/jira/browse/QPID-7618
>             Project: Qpid
>          Issue Type: New Feature
>          Components: Java Broker
>    Affects Versions: qpid-java-6.1.1, qpid-java-7.0
>            Reporter: Tomas Vavricka
>              Labels: policy-type, queue, ring
>         Attachments: 0001-QPID-7569-Ring-policy-type.patch
>
>
> It would be good if Java Broker will support ring policy.
> Ring policy - delete oldest message(s) when queue capacity is reached
> Queue capacity can be defined by maximum count of message and maximum size of 
> messages (including header).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to