-
Notifications
You must be signed in to change notification settings - Fork 924
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
Conversation
43f377d
to
2b6fbd1
Compare
...ore-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
Show resolved
Hide resolved
...re-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
Outdated
Show resolved
Hide resolved
...s/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
Outdated
Show resolved
Hide resolved
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! |
...s/src/test/java/org/apache/activemq/artemis/tests/integration/client/MessageHandlerTest.java
Outdated
Show resolved
Hide resolved
2b6fbd1
to
3da1cb2
Compare
9f6ace0
to
cf09c35
Compare
while (!messageHandlerFinished.get()) { | ||
try { | ||
Thread.sleep(10); | ||
} catch (InterruptedException e) { | ||
// ignore | ||
} | ||
} | ||
messageHandlerFinished.set(true); |
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 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.
cf09c35
to
7c3df85
Compare
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. |
7c3df85
to
fa93b0f
Compare
There wasn't a clear place to add documentation about this so I'm relying on JavaDoc.