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

ARTEMIS-5093 support configurable onMessage timeout w/closing consumer #5291

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

jbertram
Copy link
Contributor

There wasn't a clear place to add documentation about this so I'm relying on JavaDoc.

@coocoo1112
Copy link

coocoo1112 commented Nov 13, 2024

Hey sorry, I was just wondering if there was any update on this or plans to get it into a new version? Thank you so much for starting the implementation process though!

@jbertram jbertram force-pushed the ARTEMIS-5093 branch 3 times, most recently from 9f6ace0 to cf09c35 Compare November 25, 2024 17:12
Comment on lines 143 to 150
while (!messageHandlerFinished.get()) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// ignore
}
}
messageHandlerFinished.set(true);
Copy link
Member

Choose a reason for hiding this comment

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

I would use a different boolean for the looping and the completion checking, it would be much clearer, and also means the set(true) doesnt then seem like dead-code (it can only ever execute here if it is already true).

The messageHandlerFinished.set(true); should also go in a try-finally so that the later assertFalse on it is guarding against unexpected-exits as well as the sole expected one being set up by the test.

You could then also wait for it to trip before the test method exits. Maybe using a CDL instead of an AtomicBoolean actually to make that succinct and efficient.

@gemmellr
Copy link
Member

I rebased your changes, and added another temporary commit with some further changes (around the last feedback comment, and also adding a check for the tweaked timeout log message, a timeout for the overall test, reducing the close timeout a bit further).

If you are happy with the overall change we can squash them and push.

@jbertram jbertram merged commit a5f317d into apache:main Dec 2, 2024
8 checks passed
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.

5 participants