google-code-export / typica

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

Incorrect Queue returned from SQSUtils.getQueueService() #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

for ( MessageQueue mq : msgQueuesFound ) {
   if ( mq.getUrl().toString().endsWith( msgQueueName ) ) {
                                msgQueueFound = mq;
      }
}

The name resolution is incorrect.  If I have queue by the name of FooBar
and another by the name of Bar.  And if FooBar was instantiated before Bar.  

The getQueueService() method would end up serving FooBar when requesting Bar.

Original issue reported on code.google.com by usa...@gmail.com on 23 Jan 2009 at 1:53

GoogleCodeExporter commented 9 years ago
I was thinking of addressing this and I'm inclined to leave it alone. The 
methods in SQSUtils (up to 
getMessageQueue()) came from the Amazon SQS code, included for compatibility. 
To be honest, I don't 
recommend using this method. It makes a call to list the queues prior to 
actually creating the queue (if 
necessary). It is more efficient to simply create a queue by name using 
QueueService.getOrCreateMessageQueue(), or SQSUtils.getQueueOrElse().

Original comment by dkavan...@gmail.com on 3 Feb 2009 at 3:57