nickgrealy / aws-sqs

Jenkins plugin that triggers builds on events that are published via Amazon Simple Queue Service (SQS) (Allow default IAM access (no access/security keys required).
Apache License 2.0
0 stars 41 forks source link

Multiple Listeners triggering same job #5

Open pherris opened 7 years ago

pherris commented 7 years ago

SQS is sending a single message, but my job is being triggered multiple times. I believe this is due to multiple listeners being registered:

https://github.com/jenkinsci/aws-sqs-plugin/blob/2690f662d05e92e863d0bc1527b16770f38fda50/src/main/java/io/relution/jenkins/awssqs/threading/SQSQueueMonitorImpl.java#L193-L195

This seems to be born out with info from the Jenkins log:

0001CA Received 1 message(s) from MY-QUEUE-NAME (sqs.us-west-2.amazonaws.com) {7e088060-ab00-45b7-b05b-00a956e57c43} Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Message received... Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Triggering job with 4 parameters... Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Triggering job [COMPLETED] Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Message received... Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Triggering job with 4 parameters... Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Triggering job [COMPLETED] Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Send delete request for 1 message(s) to MY-QUEUE-NAME (sqs.us-west-2.amazonaws.com) {7e088060-ab00-45b7-b05b-00a956e57c43} Jul 06, 2017 5:30:05 AM INFO io.relution.jenkins.awssqs.logging.Log write 0001CA Deleted 1 message(s) (0 failed) from MY-QUEUE-NAME (sqs.us-west-2.amazonaws.com) {7e088060-ab00-45b7-b05b-00a956e57c43}

I'm not able to see why multiple listeners were registered or how to prevent this from happening in the future. Any suggestions/pointers?