|
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
import org.springframework.amqp.core.AcknowledgeMode;
|
|
|
|
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode;
|
|
|
|
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.ConfirmType;
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
|
|
|
|
|
import org.springframework.boot.convert.DurationUnit;
|
|
|
|
@ -87,14 +88,14 @@ public class RabbitProperties {
|
|
|
|
|
private Duration requestedHeartbeat;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether to enable publisher confirms.
|
|
|
|
|
* Whether to enable publisher returns.
|
|
|
|
|
*/
|
|
|
|
|
private boolean publisherConfirms;
|
|
|
|
|
private boolean publisherReturns;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether to enable publisher returns.
|
|
|
|
|
* Type of publisher confirms to use.
|
|
|
|
|
*/
|
|
|
|
|
private boolean publisherReturns;
|
|
|
|
|
private ConfirmType publisherConfirmType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Connection timeout. Set it to zero to wait forever.
|
|
|
|
@ -274,12 +275,15 @@ public class RabbitProperties {
|
|
|
|
|
this.requestedHeartbeat = requestedHeartbeat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeprecatedConfigurationProperty(reason = "replaced to support additional confirm types",
|
|
|
|
|
replacement = "spring.rabbitmq.publisher-confirm-type")
|
|
|
|
|
public boolean isPublisherConfirms() {
|
|
|
|
|
return this.publisherConfirms;
|
|
|
|
|
return this.publisherConfirmType.equals(ConfirmType.CORRELATED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
|
public void setPublisherConfirms(boolean publisherConfirms) {
|
|
|
|
|
this.publisherConfirms = publisherConfirms;
|
|
|
|
|
this.publisherConfirmType = (publisherConfirms) ? ConfirmType.CORRELATED : ConfirmType.NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isPublisherReturns() {
|
|
|
|
@ -294,6 +298,14 @@ public class RabbitProperties {
|
|
|
|
|
return this.connectionTimeout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setPublisherConfirmType(ConfirmType publisherConfirmType) {
|
|
|
|
|
this.publisherConfirmType = publisherConfirmType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ConfirmType getPublisherConfirmType() {
|
|
|
|
|
return this.publisherConfirmType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setConnectionTimeout(Duration connectionTimeout) {
|
|
|
|
|
this.connectionTimeout = connectionTimeout;
|
|
|
|
|
}
|
|
|
|
|