The Daily WTF
Eric writes:
Yes, we actually do have code reviews and testing practices. A version of this code was tested successfully prior to this version being merged in, somehow.
Well, that’s ominous. Let’s look at the code.
public static SqsClient create() { try { SqsClient sqsClient = SqsClient.builder() … .build(); return sqsClient; } catch (Exception e) { log.error(“SQS – exception creating sqs client”, e); } finally { // Uncomment this to test the sqs in a test environment // return SqsClient.builder(). … .build(); return null; } }
Eric found this when he discovered that the application wasn’t sending messages to their queue. According to the logs, there were messages to send, they just weren’t being sent.
Eric made the mistake of looking for log messages around sending messages, when instead he should have been looking at module startup, where the error message above appeared.
This code attempts to
To read the full article click on the 'post' link at the top.