Closed
Description
Enhancement
Regarding javadoc of eg convertSendAndReceiveAsType(...)
Returns:
the response if there is one. [I suggest adding: null on timeout]
Throws:
AmqpException - if there is a problem.
As for me documentation doesn't state it clearly that on timeout null is returned.
It's inconsistent with Future.get(long timeout, TimeUnit unit)
RabbitTemplate:
@Nullable
public Message get(long timeout, TimeUnit unit) throws InterruptedException {
try {
return this.future.get(timeout, unit);
}
catch (ExecutionException e) {
throw RabbitExceptionTranslator.convertRabbitAccessException(e.getCause()); // NOSONAR lost stack trace
}
catch (TimeoutException e) {
return null;
}
}
What was the design decision behind it?
Why is returning null considered better than throwing TimeoutException?