PDA

View Full Version : Default Time Out in ReplyMessageCorrelator



amsmota
Sep 5th, 2008, 08:43 AM
In ReplyMessageCorrelator we have


private volatile long defaultTimeout = 5000;

so what happens when I'm doing a Request/Reply using the SimpleMessagingGateway.sendAndReceiveWithReplyMess ageCorrelator with a replyTimeOut = -1


return (this.replyTimeout >= 0)
? this.replyMessageCorrelator.getReply(message.getHe aders().getId(), this.replyTimeout)
: this.replyMessageCorrelator.getReply(message.getHe aders().getId());

I'm invoking the getReply without a timeout, but the method invoked


public Message<?> getReply(Object correlationId) {
return this.getReply(correlationId, this.defaultTimeout);
}

uses the default value of 5000 instead of -1, and in the end, in RetrievalBlockingMessageStore it makes a


MessageHolder holder = (timeout < 0) ? queue.take() : queue.poll(timeout, TimeUnit.MILLISECONDS);

poll() instead of a take().

Is this the intended behaviour or is it a bug?

Mark Fisher
Sep 5th, 2008, 09:16 AM
That is a bug. Thank you for tracking it down so precisely. If you don't mind, could you submit this as a JIRA issue?

Thanks,
Mark

amsmota
Sep 5th, 2008, 10:44 AM
See http://jira.springframework.org/browse/INT-361.

Mark Fisher
Sep 5th, 2008, 11:39 AM
Thank you. I have set the issue's target to RC1.