Admiral-Piett / goaws

AWS (SQS/SNS) Clone for Development testing
MIT License
779 stars 144 forks source link

SQS batch not working. #212

Open Tumeloq opened 4 years ago

Tumeloq commented 4 years ago

I cannot receive batch massages always getting single message at time. Sample request Action=ReceiveMessage&Version=2012-11-05&AttributeName.1=All&MessageAttributeName.1=All&MaxNumberOfMessages=10&WaitTimeSeconds=20.

I debugged the code. gosqs.go

if app.SyncQueues.Queues[queueName].IsFIFO { // If we got messages here it means we have not processed it yet, so get next if app.SyncQueues.Queues[queueName].IsLocked(msg.GroupID) { continue } // Otherwise lock messages for group ID app.SyncQueues.Queues[queueName].LockGroup(msg.GroupID) } This runs in loop and only the first message will returned. The second iteration will execute. if app.SyncQueues.Queues[queueName].IsLocked(msg.GroupID) { continue }