Fix missing @DirtiesContext on TCP tests

- also add bean name (if available) to the gateway timeout exception message.
This commit is contained in:
Gary Russell
2021-03-12 11:43:17 -05:00
parent 13f0bde989
commit 3edfb962d2
4 changed files with 13 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2020 the original author or authors.
* Copyright 2001-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -288,7 +288,9 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler
logger.debug(() -> "Remote Timeout on " + connectionId);
// The connection is dirty - force it closed.
this.connectionFactory.forceClose(connection);
throw new MessageTimeoutException(requestMessage, "Timed out waiting for response");
String component = getComponentName();
throw new MessageTimeoutException(requestMessage, "Timed out waiting for response"
+ (component == null ? "" : "; component: " + component));
}
logger.debug(() -> "Response " + replyMessage);
return replyMessage;