Clarify concurrency of Basic and Async messaging #288
Labels
API (Both)
Impacts the client and server API
enhancement
Adding a new feature or improving an existing one
Milestone
The Javadoc for
RemoteEndpoint.Basic
has the following textThis was originally on
RemoteEndpoint
but after the refactoring toBasic
andAsync
was performed the text only appeared onBasic
.There are several issues.
The use of MAY
By defining that an exception "may" be thrown in this case, the user of this API has to code to handle this case since an exception "may" be thrown. This results in unnecessary work if the implementation opts not to throw an exception.
I suggest that this instance of "may" is changed to either "must" or "must not". I have no strong preference for either.
Inconsistent concurrency requirements.
It is not clear if this "no concurrent send message calls" requirement applies to
Async
or not. This should be clarified.Note that the TCK suggests that this requirement does not apply to
Async
.I suggest that
Basic
andAsync
follow the same rule and either both allow concurrent calls or both do not.If concurrent calls to send message methods are allowed then that raises the question of how to handle them since they are not permitted on the wire (ignoring the multiplexing extension). Do subsequent messages get buffered until the first completes? If yes, how is that buffer managed? What prevents a OOME if messages are sent slower than the application writes them? Where is the back pressure? Alternatively - and perhaps simpler to implement - do subsequent calls block until the previous call completes? In this approach are the blocked threads placed in a FIFO queue?
The text was updated successfully, but these errors were encountered: