-
Notifications
You must be signed in to change notification settings - Fork 167
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
GH-249 Added properties for handling backpressure in KplMessageHandler #250
Conversation
…plMessageHandler. Added Unit Tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks promising.
Please, consider my review.
Thanks
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTest.java
Outdated
Show resolved
Hide resolved
…max capacity. Implemented exponential retry pattern.
@artembilan : I have pushed the changes as requested, please take a look at the test cases to understand the behaviour. |
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
…vadocs. Added links and references to the properties. Removed commented code from checkstyle.
…or KPL Message Handler.
…style failures.
@artembilan : I have worked on the most of the tasks, but not clear on the the 2, which are left open. |
…o maxInFlightRecordsInitialBackoffDuration. Corrected capacity loop entry condition to use greater than zero.
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
understood, and makes sense. Having a
The advices are configured in
but the current outbound adapters are extending
If we can change the @artembilan : Please advice the next steps and if the direction I am heading into seems correct. |
I might not be clear, but I didn't ask for any custom My point is to not have any opinion, but rather just fails with an error when condition has not met yet according to the configuration. The advice is applied from the endpoint. |
Sorry, if i understood correctly this time. I am getting confused between 2 contexts - consumer and library provider context. If the threshold has breached, we throw a KPLbackPressureException. We [library providers] don't really need to define and write any custom resilience pattern in the KPL message handler. A plain condition would be simpler. |
Yes, that's my idea. |
…ed KPLBackpressureException.
@artembilan: I have done the requested changes. Can you please review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the update !
Please, don’t comment like Fixed
, Done
etc. if you agree with me and going to push. I definitely will it is fixed in your next commit(s). Otherwise it feels like a spam in my mail box and contrpriductive.
src/main/java/org/springframework/integration/aws/support/KPLBackpressureException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/support/KPLBackpressureException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/support/KPLBackpressureException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
…s with RetryAdvice.
…he KplMessageHandler class level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there.
Thank you for the update!
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
* On number of records in flight exceeding the threshold, {@link KplBackpressureException} would be thrown. | ||
* If Backpressure handling is enabled, {@link KplBackpressureException} must be handled. | ||
* | ||
* @param backPressureThreshold Defaulted to 0. Set a value greater than 0 to enable backpressure handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we need the first part since you just nailed it with the second sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant remove Defaulted to 0
.
Doesn't sounds good and covered with the next sentence.
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
* On number of records in flight exceeding the threshold, {@link KplBackpressureException} would be thrown. | ||
* If Backpressure handling is enabled, {@link KplBackpressureException} must be handled. | ||
* | ||
* @param backPressureThreshold Defaulted to 0. Set a value greater than 0 to enable backpressure handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant remove Defaulted to 0
.
Doesn't sounds good and covered with the next sentence.
src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/support/KplBackpressureException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/integration/aws/support/KplBackpressureException.java
Outdated
Show resolved
Hide resolved
src/test/java/org/springframework/integration/aws/outbound/KplMessageHandlerTests.java
Outdated
Show resolved
Hide resolved
… Revert in AbstractAwsMessageHandler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Pulling locally for final review and merge.
Merged as b5f6c39 after some minor clean up. |
Added 2 properties for handling backpressure.
Added test cases for KPL Message Handler