maheshwarirohit87 / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

Incorrect queue retrieved when multiple queues end with same string #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create three queues -- 'myorders', 'orders' and 'widgetorders'
2. Try to use SQSUtils.getMessageQueue to retrieve the 'orders' queue

What is the expected output? What do you see instead?
I end up getting either the 'myorders' or 'widgetorders' queue, NOT the
'orders' queue.

What version of the product are you using? On what operating system?
Just confirmed the latest SQSUtils.java from SVN has this bug (rev275).

Please provide any additional information below.
Line 106 of SQSUtils.java has:

--
if ( mq.getUrl().toString().endsWith( msgQueueName ) ) {
--

It should instead parse the URL to get the real queue name, then try to
match it.

Original issue reported on code.google.com by jmaho...@gmail.com on 7 Aug 2009 at 7:59

GoogleCodeExporter commented 9 years ago
agreed. Working on it.

Original comment by dkavan...@gmail.com on 13 Oct 2009 at 12:30

GoogleCodeExporter commented 9 years ago
I prefer the call SQSUtils.getQueueOrElse(). I think if you know the name of 
your queue, just ask for it directly. 
The getMessageQueue() method was there to match some functionality in the 
SQSUtils included with the 
Amazon SOAP client. As it stands, someone can provide the queue name as 
"myQueue", or with the account 
identifier, such as "365812321051/myQueue". The later is helpful when using a 
shared queue. As it stands 
now, getMessageQueue supports both. However, it does suffer from the bug you 
mention. I'd like to do away 
with this method altogether, but perhaps I should simply mark it "deprecated". 
I find it a bit heavy to get a list 
of queues and search through them.

I'd like more input, but I'm inclined to do nothing and mark the method 
deprecated.

Original comment by dkavan...@gmail.com on 14 Oct 2009 at 1:47

GoogleCodeExporter commented 9 years ago
See issue #80

Original comment by dkavan...@gmail.com on 23 Mar 2010 at 11:02