Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERLOK-3912 Producer now uses the synch client rather than asynch. #1003

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

aaron-mcgrath-adp
Copy link
Member

@aaron-mcgrath-adp aaron-mcgrath-adp commented Aug 4, 2022

Motivation

We have recently had an issue when sending a message through the producer would fail on the server side but Interlok had no idea the message had failed. This is because Interloks implementation uses the SQS Asynch method to send messages, which returns a future. The detail of the future was being ignored.

Modification

Asynchronous messaging is not really useful when you need to know the success of a producer before you end the workflow for a single message. Therefore we now simply use the synchronous method to send a message, getting the result back immediately.

First we check for a couple of unchecked exceptions in case something goes completely wrong.
Then with the result we check the HTTP status return code is 200. If it's anything else, we fail.

PR Checklist

  • been self-reviewed.
  • Added unit tests or modified existing tests to cover new code paths
  • Tested new/updated components in the UI and at runtime in an Interlok instance
  • Reviewed java class members so that missing annotations are added (InputFieldDefault/ComponentProfile etc)
  • Checked that javadoc generation doesn't report errors
  • Checked the display of the component in the UI

Result

What's the end result for the user

Testing

How can I test this if I'm reviewing this.

@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #1003 (cfe6d5a) into develop (9c9afac) will increase coverage by 0.28%.
The diff coverage is 66.66%.

@@              Coverage Diff              @@
##             develop    #1003      +/-   ##
=============================================
+ Coverage      98.59%   98.87%   +0.28%     
  Complexity       508      508              
=============================================
  Files             81       81              
  Lines           1421     1420       -1     
  Branches          64       65       +1     
=============================================
+ Hits            1401     1404       +3     
+ Misses            16       11       -5     
- Partials           4        5       +1     
Impacted Files Coverage Δ
...n/java/com/adaptris/aws/sqs/AmazonSQSProducer.java 96.07% <66.66%> (-0.08%) ⬇️
...main/java/com/adaptris/aws/s3/UploadOperation.java 95.45% <0.00%> (+4.54%) ⬆️
...in/java/com/adaptris/aws/s3/DownloadOperation.java 90.00% <0.00%> (+5.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

… do extend Exception and not Error, so no need.
Copy link
Contributor

@sebastien-belin-adp sebastien-belin-adp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it but the changes look fine and actually make sense.

@sebastien-belin-adp
Copy link
Contributor

@aaron-mcgrath-adp It may worth to apply the same changes to interlok-aws2-sqs?

@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants