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/03/21 13:36:50 UTC

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

Implemention of selector using Xquery
-------------------------------------

                 Key: QPID-1766
                 URL: https://issues.apache.org/jira/browse/QPID-1766
             Project: Qpid
          Issue Type: New Feature
          Components: C++ Broker, C++ Client
         Environment: Linux
            Reporter: chenta lee


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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: message_selector_pytest.patch

Add python example for testing.

The testing program combined four different kinds of subscribers:
     1. regular subscriber using direct exchange
     2. regular subscriber using direct exchange in browse mode
     3. subscriber using message selector
     4. subscriber using message selector in browse mode

> 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: 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
>
>
> 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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694077#action_12694077 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


I will be on the plane to the AMQP F2F today and will integrate this and create the plugin on the trip. Hopefully commit it tomorrow

Carl.

> 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: Makefile.patch, Makefile.patch, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ 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


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

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688311#action_12688311 ] 

Gordon Sim commented on QPID-1766:
----------------------------------

Commented out lines should be removed before committing; there are also some whitespace issues.

The change to Daemon.cpp should probably be separated out into a separate patch.

SemanticState::ConsumerImpl::filter() needs a test for the case where there are no application headers in the message.

> 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: Makefile.patch, selector.patch, selector.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12696065#action_12696065 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


patch working, doing some makefile fiddling before commit.

> 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: Makefile.patch, Makefile.patch, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: selector.patch

Thank you Gordan, I fixed  the locking bug.
And Carl mention me that I still use popAnddequeue in Queue::consumNextMessage.  I also fixed this.

I found out that the field "Message& msg" in Queue::seek  function is unnecessary. Because I already pass an iterator into it. So I did some modification.

However, I am curious about why do we need another message variable in popAndDequeue. Can't we  just dequeue it first and then pop the message? Because I am not sure if store->dequeue will modify the queue so I did the same way in earseAndDequeue.

> 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: Makefile.patch, selector.patch, selector.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757977#action_12757977 ] 

Gordon Sim commented on QPID-1766:
----------------------------------

SelectorModule.h does not appear to be part of the latest patch. 

The use of a sequence number assigned from the position of the consumer that never gets updated for the consume case will be a problem for wrap-around of the sequence number I think.

> 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, prime_number.diff, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip, selector_new.diff, selector_pytest.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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750908#action_12750908 ] 

chenta lee commented on QPID-1766:
----------------------------------

I finally have sometime to look into this problem.

This problem is cause by the way we requeue messages. After enabled selector, the position property of  consumer will be varying.
However, after requeue the message, which might caused by message rollback, release ... I forgot to update the position property of consumer, so the client won't receive any requeued message.

When I try to add code to update the position property, I found out that I have to insert code before invoking requeue, e.g. in SemanticState::recover, SemanticState::rollback and SemanticState::release. That is not an elegant way.
So I am thinking if we can retrieved the consumer information in Queue::requeue then I only need to update the position property at one place, and it is more efficient.

But to do that I have to add a share pointer pointed to consumer to the structure of QueuedMessage, and update the consumer info when dispatching the message. Do you think it is a correct way to solve this problem?

> 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
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754964#action_12754964 ] 

chenta lee commented on QPID-1766:
----------------------------------

After some experiment, add a point to consumer in QueuedMessage can solve the problem and past the python test. 

However, if I only put one consumer point in the QueuedMessge that also mean I can only update one consumer's position property when requeue the message. I am thinking that if we requeued a message, does it also mean that this message is available to ALL consumers? so I need to update the position property to ALL consumer. Am I correct?

If my assumption is correct, then I need to find all the functions that invoke Queue::requeue and insert some code before calling it.

> 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
>
>
> 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


[jira] Issue Comment Edited: (QPID-1766) Implemention of selector using Xquery

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754964#action_12754964 ] 

chenta lee edited comment on QPID-1766 at 9/14/09 5:49 AM:
-----------------------------------------------------------

After some experiment, add a pointer to consumer in QueuedMessage can solve the problem and past the python test. 

However, if I only put one consumer pointer in the QueuedMessge that also mean I can only update one consumer's position property when requeue the message. I am thinking that if we requeued a message, does it also mean that this message is available to ALL consumers? so I need to update the position property to ALL consumer. Am I correct?

If my assumption is correct, then I need to find all the functions that invoke Queue::requeue and insert some code before calling it.

      was (Author: chenta):
    After some experiment, add a point to consumer in QueuedMessage can solve the problem and past the python test. 

However, if I only put one consumer point in the QueuedMessge that also mean I can only update one consumer's position property when requeue the message. I am thinking that if we requeued a message, does it also mean that this message is available to ALL consumers? so I need to update the position property to ALL consumer. Am I correct?

If my assumption is correct, then I need to find all the functions that invoke Queue::requeue and insert some code before calling it.
  
> 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
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: selector_patch_20090922.diff

I forgot the add the header files before creating the new patch.

Actually I didn't use any new algorithm, I just follow the original algorithm (the one before apply the selector patch), and change a little implemetation detail. So I think it won't be a problem.
What do you mean by wrap-around the sequence number? It will be helpful if you could provide an example.

If I update the position property of consumer, it will be troublesome to requeue the message. 

> 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, prime_number.diff, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip, selector_new.diff, selector_patch_20090922.diff, selector_pytest.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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: prime_number.diff

Here is an example that use selector to get the prime number between 1~100


> 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, prime_number.diff, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip, selector_new.diff, selector_pytest.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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757786#action_12757786 ] 

chenta lee commented on QPID-1766:
----------------------------------

Yes, it is ready to test again.

About the new algorithm I used, how much will it impact the performance do you think?

btw, I am writing a python example which use selector to find the prime number that I think is an interesting example.


> 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, selector_pytest.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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757782#action_12757782 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


Ready for me to test it again for you?

Carl.

> 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, selector_pytest.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


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

Posted by Jonathan Robie <jo...@redhat.com>.
chenta lee wrote:
> I already add an option to let user decide whether parse the content or
> not.
> setting.arguments.setInt("qpid.selector_parse_content", 1);
>
> set qpid.selector_parse_content to 1 will enable broker to parse the message
> content, vice versa.
>
>   

The XML Exchange no longer parses message content if the binding query 
does not use it. A query that uses only headers never parses the 
message, you don't need a flag for that. I don't know how that relateds 
to the change you made, but if you are leveraging the XML Exchange, you 
don't need this.

Jonathan

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


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

Posted by Gordon Sim <gs...@redhat.com>.
Carl Trieloff wrote:
> Gordon Sim wrote:
>> Jonathan Robie wrote:
>>> Let me know when its good to go, and I'll test it and commit it. 
>>> (Unless someone objects.)
>>
>> As stated in my comment on the Jira I think the xerces/xqilla 
>> dependencies need to be managed better for this. Ideally it would form 
>> a plugin, but at the very least we need to make sure that configure 
>> checks for the dependencies and disables this feature if they are not 
>> present. 
> 
> I had offered to help Chanta get it into a plug-in once he has the other 
> items done.

Excellent!

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


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

Posted by Carl Trieloff <cc...@redhat.com>.
Gordon Sim wrote:
> Jonathan Robie wrote:
>> Let me know when its good to go, and I'll test it and commit it. 
>> (Unless someone objects.)
>
> As stated in my comment on the Jira I think the xerces/xqilla 
> dependencies need to be managed better for this. Ideally it would form 
> a plugin, but at the very least we need to make sure that configure 
> checks for the dependencies and disables this feature if they are not 
> present. 

I had offered to help Chanta get it into a plug-in once he has the other 
items done.

regards
Carl.

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


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

Posted by Jonathan Robie <jo...@redhat.com>.
Gordon Sim wrote:
> Jonathan Robie wrote:
>> Let me know when its good to go, and I'll test it and commit it. 
>> (Unless someone objects.)
>
> As stated in my comment on the Jira I think the xerces/xqilla 
> dependencies need to be managed better for this. Ideally it would form 
> a plugin, but at the very least we need to make sure that configure 
> checks for the dependencies and disables this feature if they are not 
> present.

Yes, I absolutely agree.

The XML Exchange is a plugin, and autotools tests for the presence of 
XQilla to decide whether to build the XML Exchange. I think we should do 
selectors the same way.

Jonathan

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


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

Posted by Gordon Sim <gs...@redhat.com>.
Jonathan Robie wrote:
> Let me know when its good to go, and I'll test it and commit it. (Unless 
> someone objects.)

As stated in my comment on the Jira I think the xerces/xqilla 
dependencies need to be managed better for this. Ideally it would form a 
plugin, but at the very least we need to make sure that configure checks 
for the dependencies and disables this feature if they are not present.

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


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

Posted by Jonathan Robie <jo...@redhat.com>.
By the way, I really like this.

Let me know when its good to go, and I'll test it and commit it. (Unless 
someone objects.)

Jonathan

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


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

Posted by Jonathan Robie <jo...@redhat.com>.
chenta lee wrote:
> Thank you!!Your explanation is very helpful! I will modify the code ASAP.
> BTW, I didn't handle the type parser very well. Currently I can only handle
> string and integer type. I am thinking maybe we can use the types defined in
> "FieldValue" to create a map and register the corresponding type handler to
> it. How do you think about that?
>   

Yes, I'm afraid I don't handle the incoming data types terribly well 
myself.

You may have noticed this comment in my source:

      if (args) {
          FieldTable::ValueMap::const_iterator v = args->begin();
          for(; v != args->end(); ++v) {
              // ### TODO: Do types properly

The right thing to do is to check the AMQP type here and convert to the 
appropriate XQuery type. I'll do that to my source now  and let you know 
when I'm done ...

Jonathan

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


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

Posted by chenta lee <ch...@gmail.com>.
Thank you!!Your explanation is very helpful! I will modify the code ASAP.
BTW, I didn't handle the type parser very well. Currently I can only handle
string and integer type. I am thinking maybe we can use the types defined in
"FieldValue" to create a map and register the corresponding type handler to
it. How do you think about that?

Chenta

On Mon, Mar 23, 2009 at 10:51 PM, Jonathan Robie
<jo...@redhat.com>wrote:

> chenta lee wrote:
>
>> I already add an option to let user decide whether parse the content or
>> not.
>> setting.arguments.setInt("qpid.selector_parse_content", 1);
>>
>> set qpid.selector_parse_content to 1 will enable broker to parse the
>> message
>> content, vice versa.
>>
>>
> Does your code require the user to specify whether to parse the content?
> I'd rather do this automatically so it is always consistent. Parse the
> message if and only if the query requires it.
>
> After you prepare the query, you can ask XQilla if it needs to access the
> context item. If it does not, then it does not need to query the content.
> Look at the code for XmlExchange::bind, where I do this. This code is a bit
> dense, so let me spell out a few steps:
>
> Parse the query:
>
> Query query(xqilla.parse(X(queryText.c_str())));
>
> Then ask if the main body of the query uses the context (which is
> equivalent to the message body in this environmetn):
>
> if (query->getQueryBody()->getStaticAnalysis().areContextFlagsUsed()) {
>                   binding->parse_message_content = true;
> }
>
> If the main body of the query does not use the context, it's still possible
> that a global variable does, so let's check that too:
>
> GlobalVariables &vars =
> const_cast<GlobalVariables&>(query->getVariables());
> for(GlobalVariables::iterator it = vars.begin(); it != vars.end(); ++it) {
>   if ((*it)->getStaticAnalysis().areContextFlagsUsed()) {
>          binding->parse_message_content = true;
>          break;
>   }
> }
>
> In the XML Exchange, a query has only one module, it can't import
> libraries. If it could, I would have to check each module this way.
>
> Hope this is helpful!
>
> Jonathan
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

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

Posted by Jonathan Robie <jo...@redhat.com>.
chenta lee wrote:
> I already add an option to let user decide whether parse the content or
> not.
> setting.arguments.setInt("qpid.selector_parse_content", 1);
>
> set qpid.selector_parse_content to 1 will enable broker to parse the message
> content, vice versa.
>   
Does your code require the user to specify whether to parse the content? 
I'd rather do this automatically so it is always consistent. Parse the 
message if and only if the query requires it.

After you prepare the query, you can ask XQilla if it needs to access 
the context item. If it does not, then it does not need to query the 
content. Look at the code for XmlExchange::bind, where I do this. This 
code is a bit dense, so let me spell out a few steps:

Parse the query:

Query query(xqilla.parse(X(queryText.c_str())));

Then ask if the main body of the query uses the context (which is 
equivalent to the message body in this environmetn):

if (query->getQueryBody()->getStaticAnalysis().areContextFlagsUsed()) {
                    binding->parse_message_content = true;
}

If the main body of the query does not use the context, it's still 
possible that a global variable does, so let's check that too:

 GlobalVariables &vars = 
const_cast<GlobalVariables&>(query->getVariables());
 for(GlobalVariables::iterator it = vars.begin(); it != vars.end(); ++it) {
    if ((*it)->getStaticAnalysis().areContextFlagsUsed()) {
           binding->parse_message_content = true;
           break;
    }
}

In the XML Exchange, a query has only one module, it can't import 
libraries. If it could, I would have to check each module this way.

Hope this is helpful!

Jonathan

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


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

Posted by chenta lee <ch...@gmail.com>.
I already add an option to let user decide whether parse the content or
not.
setting.arguments.setInt("qpid.selector_parse_content", 1);

set qpid.selector_parse_content to 1 will enable broker to parse the message
content, vice versa.

Chenta

On Mon, Mar 23, 2009 at 10:10 AM, Carl Trieloff <cc...@redhat.com>wrote:

> Robert Greig wrote:
>
>> 2009/3/22 chenta lee <ch...@gmail.com>:
>>
>>
>>
>>> Yes, what I mean is the concept of message selector, not how we implement
>>> it. And Xquery is mush more powerful than SQL-92 syntax.By MQ, I refer to
>>> Message Queue instead of a particular message queue project.
>>>
>>>
>>
>> OK. xquery may be semantically richer but the JMS message selector
>> functionality operates on message headers not message bodies.
>> Selecting on headers will be hugely faster than on the body. There are
>> clear use cases for both.
>>
>>
>>
>
>
> I know Jonathan has updated the XML exchange to not parse the body if the
> Query only specifies
> headers. We should do that here too.
>
>
>  I am a little confused about how could my patches related to patent issue?
>>>
>>>
>>
>> I am not sure of the details of exactly what Red Hat has patented (I
>> have not read the patent text myself). However the Red Hat people are
>> on this mailing list so I am sure they will be able to clarify. From
>> what I have read, the patent covers an AMQP exchange that implements
>> xquery which is not what you are describing.
>>
>>
>>
>
> no, it isn't related at all. The piece that it covered has already been
> provided under a license grant to
> the ASF (XML Exchange), and will be feely licensed to anyone that uses AMQP
> if it is ever granted.
>
> regards,
> Carl.
>

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

Posted by Carl Trieloff <cc...@redhat.com>.
Robert Greig wrote:
> 2009/3/22 chenta lee <ch...@gmail.com>:
>
>   
>> Yes, what I mean is the concept of message selector, not how we implement
>> it. And Xquery is mush more powerful than SQL-92 syntax.By MQ, I refer to
>> Message Queue instead of a particular message queue project.
>>     
>
> OK. xquery may be semantically richer but the JMS message selector
> functionality operates on message headers not message bodies.
> Selecting on headers will be hugely faster than on the body. There are
> clear use cases for both.
>
>   


I know Jonathan has updated the XML exchange to not parse the body if 
the Query only specifies
headers. We should do that here too.


>> I am a little confused about how could my patches related to patent issue?
>>     
>
> I am not sure of the details of exactly what Red Hat has patented (I
> have not read the patent text myself). However the Red Hat people are
> on this mailing list so I am sure they will be able to clarify. From
> what I have read, the patent covers an AMQP exchange that implements
> xquery which is not what you are describing.
>
>   

no, it isn't related at all. The piece that it covered has already been 
provided under a license grant to
the ASF (XML Exchange), and will be feely licensed to anyone that uses 
AMQP if it is ever granted.

regards,
Carl.

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

Posted by Robert Greig <ro...@gmail.com>.
2009/3/22 chenta lee <ch...@gmail.com>:

> Yes, what I mean is the concept of message selector, not how we implement
> it. And Xquery is mush more powerful than SQL-92 syntax.By MQ, I refer to
> Message Queue instead of a particular message queue project.

OK. xquery may be semantically richer but the JMS message selector
functionality operates on message headers not message bodies.
Selecting on headers will be hugely faster than on the body. There are
clear use cases for both.

> I am a little confused about how could my patches related to patent issue?

I am not sure of the details of exactly what Red Hat has patented (I
have not read the patent text myself). However the Red Hat people are
on this mailing list so I am sure they will be able to clarify. From
what I have read, the patent covers an AMQP exchange that implements
xquery which is not what you are describing.

RG

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


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

Posted by chenta lee <ch...@gmail.com>.
Yes, what I mean is the concept of message selector, not how we implement
it. And Xquery is mush more powerful than SQL-92 syntax.By MQ, I refer to
Message Queue instead of a particular message queue project.

I am a little confused about how could my patches related to patent issue?

Chenta

On Sun, Mar 22, 2009 at 9:10 PM, Robert Greig <ro...@gmail.com>wrote:

> 2009/3/22 chenta lee <ch...@gmail.com>:
>
> > Message selector is a popular and essential feature for MQ(ActiveMQ
> already
> > implemented it). I am not sure if they can patent it.
>
> Can you be a bit more explicit about what you mean? Are you referring
> the JMS selectors but with semantics that enable the use of xquery on
> message content, rather than the SQL-like syntax on message headers
> (as defined in the JMS specification)?
>
> Also by MQ are you referring to IBM MQ? IBM MQ does not as far as I am
> aware implement xquery selectors as described above.
>
> RG
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

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

Posted by Robert Greig <ro...@gmail.com>.
2009/3/22 chenta lee <ch...@gmail.com>:

> Message selector is a popular and essential feature for MQ(ActiveMQ already
> implemented it). I am not sure if they can patent it.

Can you be a bit more explicit about what you mean? Are you referring
the JMS selectors but with semantics that enable the use of xquery on
message content, rather than the SQL-like syntax on message headers
(as defined in the JMS specification)?

Also by MQ are you referring to IBM MQ? IBM MQ does not as far as I am
aware implement xquery selectors as described above.

RG

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


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

Posted by chenta lee <ch...@gmail.com>.
Message selector is a popular and essential feature for MQ(ActiveMQ already
implemented it). I am not sure if they can patent it.
Chenta

On Sun, Mar 22, 2009 at 4:18 AM, James Mansion <james@mansionfamily.plus.com
> wrote:

> chenta lee (JIRA) wrote:
>
>>     [
>> https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>>
>>
> Is this the stuff that Red Hat is trying to patent?
>
> James
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

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

Posted by James Mansion <ja...@mansionfamily.plus.com>.
chenta lee (JIRA) wrote:
>      [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>   
Is this the stuff that Red Hat is trying to patent?

James


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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Issue Type: Improvement  (was: New Feature)

> 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: Makefile.patch, selector.patch, selector_client.patch
>
>
> 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


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

Posted by Carl Trieloff <cc...@redhat.com>.

Chenta,

See JIRA with the refoctor into plug-in with how far I have worked it.

regards
Carl.



Carl Trieloff (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698302#action_12698302 ] 
>
> Carl Trieloff commented on QPID-1766:
> -------------------------------------
>
>
> selector.diff includes all previous attached patches.
>
> Carl.
>
>   
>> 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: Makefile.patch, Makefile.patch, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>>
>>
>> I implemented the message selector for C++ broker and client using Xquery.
>> I will attach an example later.
>>     
>
>   


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698302#action_12698302 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


selector.diff includes all previous attached patches.

Carl.

> 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: Makefile.patch, Makefile.patch, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: selector_pytest.diff

Add unit tests for selector to python testing framework.

I added two unit tests:
1. test_message_selector
    Filter the message by header and xml content.  
2. test_message_selector_not_acquired
    Filter the message by header and xml content in browsing mode.

> 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, selector_pytest.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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: Makefile.patch
                selector_client.patch
                selector_broker.patch

1. I sync the patch to match the trunk. 
2. Thanks for Jonathan, the selector can automatically decide to parse the content or not.
3. I already handle the message with no application header in my first patch.
4. I found out that I didn't handle the Queue::requeue correctly! The requeue message should be insert into correct position. I fix this bug too.

> 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: Makefile.patch, Makefile.patch, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Trieloff updated QPID-1766:
--------------------------------

    Attachment: selector.diff

Patch of refactor into XML plugin

> 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: Makefile.patch, Makefile.patch, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Jonathan Robie (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Robie updated QPID-1766:
---------------------------------

    Attachment: chenta.diff

Based on current trunk.

Combines both of the latest patch files contributed by Chenta.

> 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
>
>
> 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


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

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688266#action_12688266 ] 

Gordon Sim commented on QPID-1766:
----------------------------------

Couple of comments on the broker side patch:

(1) we really want to keep the dependency on xqilla etc conditional as it is for the xml exchange plugin; I suggest some form of selector registry that plugins can register with or at the very least a check for the deps in configure and conditional inclusion of this feature

(2) the locking looks wrong to me; the lock is held for the seek then released and reacquired for the eares at which point the message may already have been taken

> 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: Makefile.patch, selector.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751064#action_12751064 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


Thats seems like a reasonable approach, but can't quite picture it.  I.e. I am trying to reason through checking that a circular reference is not created and that we would then leak messages. Maybe a patch fragment would be able to help full that out, but that would be my main concern from your description



> 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
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: selector.diff

Fix the segmentation fault.

The declaration order of XQilla and selectorQuery is wrong. XQilla should be declared before selectorQuery, because the selectorQuery should be destruct before XQilla. It is the reason we got segmentation fault when destructing the ConsumerImpl.

> 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: Makefile.patch, Makefile.patch, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698299#action_12698299 ] 

Carl Trieloff commented on QPID-1766:
-------------------------------------


The patch is close, two issues need to be resolved before commit:

1.) I am able to create a core, this might be due to a mistake in my refactor to make it into a plug-in, or something else. I have not had time to look into that.
2.) We need to add a test, python test would be the way to go.

I have attached the pa,tch, with all everything I have added to Chenta's work....

I have move the selector into the XML exchange plugin, so both get loaded at one.

Below is the backtrace from the core.

(gdb) bt
#0  0x0000003425fbc110 in vtable for xercesc_2_8::PanicHandler () from /usr/lib64/libxerces-c.so.28
#1  0x000000342616f528 in xercesc_2_8::RefHash2KeysTableOf<VarHashEntry<StaticAnalysis const*> >::removeAll ()
   from /usr/lib64/libxqilla.so.4
#2  0x0000003426172720 in XQContextImpl::~XQContextImpl () from /usr/lib64/libxqilla.so.4
#3  0x00000034261c5103 in XQQuery::~XQQuery () from /usr/lib64/libxqilla.so.4
#4  0x00007f5582f80b32 in checked_delete<XQQuery> (x=<value optimized out>) at /usr/include/boost/checked_delete.hpp:34
#5  boost::detail::sp_counted_impl_p<XQQuery>::dispose (this=<value optimized out>) at /usr/include/boost/detail/sp_counted_impl.hpp:79
#6  0x00007f5582f85a61 in boost::detail::sp_counted_base::release () at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
#7  ~shared_count () at /usr/include/boost/detail/shared_count.hpp:205
#8  ~shared_ptr () at /usr/include/boost/shared_ptr.hpp:131
#9  ~SelectorImpl (this=0x10e2d90) at qpid/xml/Selector.h:48
#10 0x00007f5583ba6bcb in boost::detail::sp_counted_base::release () at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
#11 ~shared_count () at /usr/include/boost/detail/shared_count.hpp:205
#12 ~shared_ptr () at /usr/include/boost/shared_ptr.hpp:131
#13 ~ConsumerImpl (this=0x10e1f80) at qpid/broker/SemanticState.cpp:338
#14 0x00007f5583b29e39 in boost::detail::sp_counted_base::release () at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
#15 ~shared_count (this=<value optimized out>) at /usr/include/boost/detail/shared_count.hpp:205
#16 0x00007f5583ba8498 in ~shared_ptr () at /usr/include/boost/shared_ptr.hpp:131
#17 ~pair () at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/stl_pair.h:73
#18 __gnu_cxx::new_allocator<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > >::destroy ()
    at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/ext/new_allocator.h:118
#19 std::_Rb_tree<std::string, std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> >, std::_Select1st<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > >, std::less<std::string>, std::allocator<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > > >::_M_destroy_node ()
    at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/stl_tree.h:390
#20 std::_Rb_tree<std::string, std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> >, std::_Select1st<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > >, std::less<std::string>, std::allocator<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > > >::erase ()
    at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/stl_tree.h:1319
#21 std::map<std::string, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl>, std::less<std::string>, std::allocator<std::pair<std::string const, boost::shared_ptr<qpid::broker::SemanticState::ConsumerImpl> > > >::erase ()
    at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/stl_map.h:523
#22 qpid::broker::SemanticState::cancel (this=0x10e8de8, tag=@0x10e86d0) at qpid/broker/SemanticState.cpp:100
#23 0x00007f5583bab5ec in qpid::broker::SessionAdapter::MessageHandlerImpl::cancel (this=0x10e8fa8, destination=@0x1157fa0)
    at qpid/broker/SessionAdapter.cpp:496
#24 0x00007f558370ad12 in std::string::_M_rep ()
    at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.h:286
#25 ~basic_string () at /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../include/c++/4.3.2/bits/basic_string.h:494
#26 ~Result () at ./qpid/framing/Invoker.h:41
#27 ~Invoker () at ./qpid/framing/Invoker.h:39
#28 ~Invoker (this=0x109f4d0) at gen/qpid/framing/ClientInvoker.h:138
#29 0x00007f558370c9b0 in ?? () from /home/cctrieloff/apache/qpid1/cpp/src/.libs/libqpidcommon.so.0
#30 0x00007f5583a3e6f0 in vtable for qpid::framing::AMQP_ClientOperations::ConnectionHandler::Invoker ()


> 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: Makefile.patch, Makefile.patch, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: selector_example.zip

Here is the example for message selector

> 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: Makefile.patch, selector.patch, selector_client.patch, selector_example.zip
>
>
> 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


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

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: Makefile.patch
                selector_client.patch
                selector.patch

The current version work for all c++ clients on all platform but it only work with c++ broker under Linux.

I will attach an example and also add an option to test/perftest.cpp later.

> Implemention of selector using Xquery
> -------------------------------------
>
>                 Key: QPID-1766
>                 URL: https://issues.apache.org/jira/browse/QPID-1766
>             Project: Qpid
>          Issue Type: New Feature
>          Components: C++ Broker, C++ Client
>         Environment: Linux
>            Reporter: chenta lee
>         Attachments: Makefile.patch, selector.patch, selector_client.patch
>
>
> 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


[jira] Issue Comment Edited: (QPID-1766) Implemention of selector using Xquery

Posted by "chenta lee (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12758105#action_12758105 ] 

chenta lee edited comment on QPID-1766 at 9/21/09 8:08 PM:
-----------------------------------------------------------

I forgot to add the header files before creating the new patch.

Actually I didn't use any new algorithm, I just follow the original algorithm (the one before apply the selector patch), and change a little implemetation detail. So I think it won't be a problem.
What do you mean by wrap-around the sequence number? It will be helpful if you could provide an example.

If I update the position property of consumer, it will be troublesome to requeue the message. 

      was (Author: chenta):
    I forgot the add the header files before creating the new patch.

Actually I didn't use any new algorithm, I just follow the original algorithm (the one before apply the selector patch), and change a little implemetation detail. So I think it won't be a problem.
What do you mean by wrap-around the sequence number? It will be helpful if you could provide an example.

If I update the position property of consumer, it will be troublesome to requeue the message. 
  
> 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, prime_number.diff, selector.diff, selector.diff, selector.patch, selector.patch, selector_broker.patch, selector_client.patch, selector_client.patch, selector_example.zip, selector_new.diff, selector_patch_20090922.diff, selector_pytest.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


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

Posted by "Jonathan Robie (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718947#action_12718947 ] 

Jonathan Robie commented on QPID-1766:
--------------------------------------

On RHEL5, I am getting two errors with $ make check, they do not occur with a pristine trunk checkout.

I haven't investigated yet, but the output indicates that both are timeout errors related to queues:

======================================================================
ERROR: test_release_ordering (tests_0-10.message.MessageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jrobie/qpid/qpid/python/tests_0-10/message.py", line 636, in test_release_ordering
    self.assertEquals("released message %s" % (i), queue.get(timeout = 1).body)
  File "/home/jrobie/qpid/qpid/python/qpid/queue.py", line 50, in get
    result = BaseQueue.get(self, block, timeout)
  File "/usr/lib64/python2.4/Queue.py", line 127, in get
    raise Empty
Empty

======================================================================
ERROR: test_rollback (tests_0-10.tx.TxTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jrobie/qpid/qpid/python/tests_0-10/tx.py", line 157, in test_rollback
    msg = queue_a.get(timeout=1)
  File "/home/jrobie/qpid/qpid/python/qpid/queue.py", line 50, in get
    result = BaseQueue.get(self, block, timeout)
  File "/usr/lib64/python2.4/Queue.py", line 127, in get
    raise Empty
Empty


> 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
>
>
> 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