MessageSelector Syntax

Asked by Michel Barakat

Hi,

I'd like to subscribe to specific messages on a queue using the MessageSelector.
I am creating the queue using the following.

        od = pymqi.makeQDesc(queue_name)
        selection_query = "SPORT= 'football'"
        od.set_vs('SelectionString', selection_query)
        queue = pymqi.Queue(qmgr, od)

However, when fetching the messages using:
        message = queue.get(None, md, gmo)

I receive messages not fitting the above criteria.
Is there anything I'm doing wrong?

Thanks
Michel

Question information

Language:
English Edit question
Status:
Answered
For:
PyMQI Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dariusz Suchojad (dsuch) said :
#1

> However, when fetching the messages using:
> message = queue.get(None, md, gmo)
>
> I receive messages not fitting the above criteria.
> Is there anything I'm doing wrong?

Hi Michel,

I'm not the author of this particular piece of code and I've never used
it myself but nope, I don't think there is anything wrong with how you
use .set_vs - I don't remember the particulars of subscribing to only
specific messages on a queue in MQ API but at least as far as .set_vs
goes it looks just fine.

Revision history for this message
Dariusz Suchojad (dsuch) said :
#2

I've just released PyMQI 1.3 and the development effort has moved to GitHub - https://github.com/dsuch/pymqi

Can you help with this problem?

Provide an answer of your own, or ask Michel Barakat for more information if necessary.

To post a message you must log in.