aws / aws-cloudtrail-processing-library

The AWS CloudTrail Processing Library helps Java developers to easily consume and process log files from AWS CloudTrail.
Apache License 2.0
87 stars 30 forks source link

BasicPollQueueInfo.getPolledMessageCount() is always 0 #15

Open sttarneyiat opened 3 months ago

sttarneyiat commented 3 months ago

When initialized the new BasicPollQueueInfo(), the polledMessageCount is set to 0: https://github.com/aws/aws-cloudtrail-processing-library/blob/9e03e4384742b5915c0da60b552d4c53252187fe/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L115

Upon getting the results of the request, the sqsMessages are set up and the actual count is logged: https://github.com/aws/aws-cloudtrail-processing-library/blob/9e03e4384742b5915c0da60b552d4c53252187fe/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L129

The BasicPollQueueInfo of the ProgressStatus is never updated to set the actual count.

I want to be able to check if the getSuccessPolledMessageCount() == 0, then do some additional logic, specifically, once the queue is empty, then I want to exit.