Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selector on JMSTimestamp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I would like to make a selector to get Message older than 1 minute, but I don't find the correct syntax with the JMSTimestamp.

Thanks

O.Squelin
 
O.Squelin,

I have gained some experience using message selectors with MQSeries JMS clients during the past 5 months and have received advice from far greater authorities than myself. My company's current platform includes MQSeries 5.1 and version 4 of the IBM classes for Java, and we are using selectors [carefully!] in our production environment.

If you are running with an earlier version of the Java classes you may be experiencing a java.lang.NumberFormatException. This is caused by the IBM parser attempting to interpret your JMSTimestamp value (a long) as an integer. This is of course pure speculation on my part, though I hope it is useful. The requirement is for compliance with SQL syntax relating to the WHERE clause, for example JMSTimestamp<1028588400000 AND JMSTimestamp>1028502000000.

I hope you do not mind me saying that your selector usage is a fairly obvious one, and when I too tried similarly to use them in March I had problems. Before I made a report for IBM I did a lot of research and my suspicions were raised because their then current documentation failed to provide any selector examples using long data types.

In the first paragraph I used the word 'carefully', and here I explain why. Pay particular attention to selector query performance with deeper than expected queues because it can be dreadfully slow. Test thoroughly and ask questions like how long will it take to browse a single queue containing 3800+ messages? Consider switching from a priority based queuing strategy to an arrival order based one which will guarantee that the oldest message is always at the head of the queue.

Finally, according to IBM there are good performance gains to be reaped in MQSeries 5.3 for JMS applications so it might be worth upgrading if they have addressed this usability issue (if not for reasons of support).

Best regards,

GSeanor

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top