INT-1364 AbstractMessagingGateway's default request and reply timeouts are now 1000 ms (were indefinite).

This commit is contained in:
Mark Fisher
2010-08-31 16:29:04 +00:00
parent 041ddbdf37
commit 93bc11fca7
5 changed files with 48 additions and 33 deletions

View File

@@ -43,14 +43,17 @@ import org.springframework.util.Assert;
* @author Mark Fisher
*/
public abstract class AbstractMessagingGateway extends AbstractEndpoint {
private static final long DEFAULT_TIMEOUT = 1000L;
private volatile InboundMessageMapper<Throwable> exceptionMapper;
private volatile MessageChannel requestChannel;
private volatile MessageChannel replyChannel;
private volatile long replyTimeout = 1000;
private volatile long replyTimeout = DEFAULT_TIMEOUT;
private final MessagingTemplate messagingTemplate = new MessagingTemplate();
@@ -62,6 +65,12 @@ public abstract class AbstractMessagingGateway extends AbstractEndpoint {
private final Object replyMessageCorrelatorMonitor = new Object();
public AbstractMessagingGateway() {
this.messagingTemplate.setSendTimeout(DEFAULT_TIMEOUT);
this.messagingTemplate.setReceiveTimeout(this.replyTimeout);
}
@Override
public String getComponentType(){
return "gateway";
@@ -88,7 +97,7 @@ public abstract class AbstractMessagingGateway extends AbstractEndpoint {
/**
* Set the timeout value for sending request messages. If not
* explicitly configured, the default is an indefinite timeout.
* explicitly configured, the default is one second.
*
* @param requestTimeout the timeout value in milliseconds
*/
@@ -98,7 +107,7 @@ public abstract class AbstractMessagingGateway extends AbstractEndpoint {
/**
* Set the timeout value for receiving reply messages. If not
* explicitly configured, the default is an indefinite timeout.
* explicitly configured, the default is one second.
*
* @param replyTimeout the timeout value in milliseconds
*/