AWS Rekognition任务ID不匹配问题求助:需清空SQS队列
What's Causing This?
The error you're hitting happens because leftover messages from your failed first run are still sitting in your linked SQS queue. Every time you re-run your Java code now, it pulls those old job messages first instead of the new one your latest execution creates—this is exactly why you're seeing a mismatch between the job ID your code expects and the one it receives.
How to Resolve It
Follow these straightforward steps to clear out the stale messages:
- Head to the AWS Management Console and open the SQS service.
- Locate the specific queue tied to your Rekognition job (the one your Java code is configured to listen to).
- Select the queue, then click the Purge button (note: this deletes all existing messages in the queue—double-check there's no critical data you need to keep before proceeding!).
- Once the queue is purged, re-run your Java code. It should now receive the correct job ID from the new Rekognition task you're triggering.
Quick Tip to Avoid This Later
If you're testing your code frequently, consider these habits:
- Purge the queue between test runs to ensure old messages don't interfere with new executions.
- Add a small validation check in your Java code to compare the received job ID with the one your code just created—this way you can skip any stale messages that might linger accidentally.
Your error message for reference:
"Job found was "f4ead620611a136a66826461377976d4467eee36dd9e06070bb96bd94b182a35" Job received was not job 9390b07d024dde7065189d8f99399418de75da42142d919c65be32f1f15c0885"
内容的提问来源于stack exchange,提问作者Bren Gall

