-
Notifications
You must be signed in to change notification settings - Fork 925
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
base: main
Are you sure you want to change the base?
Conversation
43f377d
to
2b6fbd1
Compare
return config.onMessageCloseTimeout; | ||
} | ||
|
||
@Override |
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.
The API docs specify the value set must be greater than zero, but there isn't any validation of that, should there be?
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.
Hmmm...That comment was left-over from a copy & paste. I went looking through the existing code to see how validation is done for other parameters, and I'm not actually seeing any. I'm continuing my investigation.
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 did look into what it does with that configuration value and since it is passing into a CountdownLatch is seems like it will not trigger an exception but will return immediately so from the standpoint of being able to be set to zero or negative it works, although seems an absurd value to assign.
boolean ok = future.await(ClientConsumerImpl.CLOSE_TIMEOUT_MILLISECONDS); | ||
boolean ok = future.await(onMessageCloseTimeout); |
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.
Is the const CLOSE_TIMEOUT_MILLISECONDS
still required?
public void testMessageHandlerCloseTimeout() throws Exception { | ||
// create Netty acceptor so client can use new onMessageCloseTimeout URL parameter | ||
server.getRemotingService().createAcceptor("netty", "tcp://127.0.0.1:61616").start(); | ||
final int timeout = 1000; |
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.
does the test work with a lower timeout to reduce the test duration?
There wasn't a clear place to add documentation about this so I'm relying on JavaDoc.