Add configuration option for channelRpcTimeout

This commit adds a configuration option to configure
RabbitConnectionFactory's channelRpcTimeout property.

See gh-23564
This commit is contained in:
Jasmine Howard
2020-10-01 17:52:21 -04:00
committed by Stephane Nicoll
parent 341bccbdd7
commit baa9d129f2
3 changed files with 17 additions and 1 deletions

View File

@@ -149,6 +149,8 @@ public class RabbitAutoConfiguration {
}
map.from(properties::getConnectionTimeout).whenNonNull().asInt(Duration::toMillis)
.to(factory::setConnectionTimeout);
map.from(properties::getChannelRpcTimeout).whenNonNull().asInt(Duration::toMillis)
.to(factory::setChannelRpcTimeout);
map.from(credentialsProvider::getIfUnique).whenNonNull().to(factory::setCredentialsProvider);
map.from(credentialsRefreshService::getIfUnique).whenNonNull().to(factory::setCredentialsRefreshService);
factory.afterPropertiesSet();

View File

@@ -119,6 +119,11 @@ public class RabbitProperties {
* Connection timeout. Set it to zero to wait forever.
*/
private Duration connectionTimeout;
/**
* Channel RPC timeout.
*/
private Duration channelRpcTimeout;
/**
* Cache configuration.
@@ -323,6 +328,10 @@ public class RabbitProperties {
public Duration getConnectionTimeout() {
return this.connectionTimeout;
}
public Duration getChannelRpcTimeout() {
return this.channelRpcTimeout;
}
public void setPublisherConfirmType(ConfirmType publisherConfirmType) {
this.publisherConfirmType = publisherConfirmType;
@@ -335,6 +344,10 @@ public class RabbitProperties {
public void setConnectionTimeout(Duration connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
public void setChannelRpcTimeout(Duration channelRpcTimeout) {
this.channelRpcTimeout = channelRpcTimeout;
}
public Cache getCache() {
return this.cache;