You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "chenta lee (JIRA)" <qp...@incubator.apache.org> on 2009/09/17 14:54:57 UTC

[jira] Updated: (QPID-1766) Implemention of selector using Xquery

     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

chenta lee updated QPID-1766:
-----------------------------

    Attachment: selector_new.diff

I solved this issue using the simplest approach.

At first, I try to update the position property before requeue the message, and I can't do that in the Queue::requeue. But it is very indirect to update this property before calling requeue:
   1. There is no info related to consumer in DeliveryRecord, so I have to modify the "SemanticState" class.
   2. I have to know if the message is canceled, ended or acquired before I update the position property, however, we already did that in "DeliveryRecord" class.
   3. The program flow looks weird.

So I decided to find another way to solve this problem.

I noticed that the original algorithm used in Queue::consumeNextMessage won't alter the position property of the consumer, and this property will only be altered in Queue::browseNextMessage. If I follow this principle, then I don't need to worry about the position property of consumers. But it will be less efficient  because we have to search the message array(deque) from the front every time. However, it is reasonable to assume that every message will be consumed by some consumer, so the overhead to search through the message array is little.

After using the new algorithm, the new selector patch can now pass the python test, and I also sync the patch to the latest revision (816140).

I will update the selector examples and the python test later.

> Implemention of selector using Xquery
> -------------------------------------
>
>                 Key: QPID-1766
>                 URL: https://issues.apache.org/jira/browse/QPID-1766
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Client
>         Environment: Linux
>            Reporter: chenta lee
>         Attachments: chenta.diff, Makefile.patch, Makefile.patch, message_selector_pytest.patch, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip, selector_new.diff
>
>
> I implemented the message selector for C++ broker and client using Xquery.
> I will attach an example later.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org