1
votes

I have recently stated working on MQ. I'm using C# 3.5 to read and write messages. I have requirement, need to read messages from one of the queue after sometime or may be next day. And this queue might contain other messages too. So i need to find only those messages which is created by me. So Any option is there, i can set while creating new messages and filter out my messages only after some time or next day when i try to read this queue.

it is possible i can read message without message or corelationids.

If you have any example/Sample , please send it me.

Thanks in advance

1
What's the problem in using MATCH MSG ID or MATCH CORRELATION ID?nitgeek

1 Answers

1
votes

MQ is optimized to get by correlId. Most common use patterns involve getting by that but you can also get by msgId. (and there's one or two other options). There is also the option from MQ 7 onwards to set message properties and then you could use selectors to achieve what you want but they are not supported in the basic .net interface but are through the XMS (IQueueBrowser for example).

I'd also think about your design - generally speaking you want to process all the messages, or use a different queue where you can get just the ones you want. Also, filtering messages has a performance hit, (especially if you go to selectors) so you dont want to be walking down long lists of messages.