private Boolean waitForJobToComplete(String jobId, String sqsQueueURL) throws InterruptedException, JsonParseException, IOException {
        Boolean messageFound = false;
        Boolean jobSuccessful = false;

        while (!messageFound) {
            out.println("Checking for messages on queue '" + sqsQueueURL + "'...");

            ReceiveMessageRequest request = new ReceiveMessageRequest(sqsQueueURL)
                .withMaxNumberOfMessages(10);
            List<Message> msgs = sqsClient.receiveMessage(request).getMessages();
            int numMsgs = msgs.size();

            if (numMsgs > 0) {
                out.println("Found " + numMsgs + " message" + (numMsgs == 1 ? "" : "s") + "; looking for job '" + jobId + "'...");

                for (Message msg : msgs) {
                    JsonNode bodyNode = parseJSON(msg.getBody());
                    String body = bodyNode.get("Message").getTextValue();

                    JsonNode descriptionNode = parseJSON(body);
                    String retrievedJobId = descriptionNode.get("JobId").getTextValue();
                    String statusCode = descriptionNode.get("StatusCode").getTextValue();

                    if (retrievedJobId.equals(jobId)) {
                        out.println("Found job '" + retrievedJobId + "' and status '" + statusCode + "'!");

                        messageFound = true;

                        if (statusCode.equals("Succeeded")) {
                            jobSuccessful = true;
                        }
                    }
                }
            }
            else {
                out.println("No messages found; sleeping '" + SLEEP_TIME + "' seconds...");
                Thread.sleep(SLEEP_TIME * 1000);
            }
        }

        return (messageFound && jobSuccessful);
    }