Polish "Support additional publisher confirm types"

See gh-17848
pull/17968/head
Madhura Bhave 5 years ago
parent 8c1c8a27d9
commit 8954fe13e5

@ -87,18 +87,13 @@ public class RabbitProperties {
@DurationUnit(ChronoUnit.SECONDS) @DurationUnit(ChronoUnit.SECONDS)
private Duration requestedHeartbeat; private Duration requestedHeartbeat;
/**
* Whether to enable publisher confirms.
*/
private boolean publisherConfirms;
/** /**
* Whether to enable publisher returns. * Whether to enable publisher returns.
*/ */
private boolean publisherReturns; private boolean publisherReturns;
/** /**
* The type of publisher confirms to use. * Type of publisher confirms to use.
*/ */
private ConfirmType publisherConfirmType; private ConfirmType publisherConfirmType;
@ -280,17 +275,15 @@ public class RabbitProperties {
this.requestedHeartbeat = requestedHeartbeat; this.requestedHeartbeat = requestedHeartbeat;
} }
@DeprecatedConfigurationProperty(reason = "replaced to support additional confirm types",
replacement = "spring.rabbitmq.publisher-confirm-type")
public boolean isPublisherConfirms() { public boolean isPublisherConfirms() {
return this.publisherConfirmType.equals(ConfirmType.CORRELATED); return this.publisherConfirmType.equals(ConfirmType.CORRELATED);
} }
@Deprecated @Deprecated
public void setPublisherConfirms(boolean publisherConfirms) { public void setPublisherConfirms(boolean publisherConfirms) {
if (publisherConfirms) { this.publisherConfirmType = (publisherConfirms) ? ConfirmType.CORRELATED : ConfirmType.NONE;
this.publisherConfirmType = ConfirmType.CORRELATED;
return;
}
this.publisherConfirmType = ConfirmType.NONE;
} }
public boolean isPublisherReturns() { public boolean isPublisherReturns() {

@ -80,6 +80,7 @@ import static org.mockito.Mockito.verify;
* @author Greg Turnquist * @author Greg Turnquist
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Gary Russell * @author Gary Russell
* @author HaiTao Zhang
*/ */
class RabbitAutoConfigurationTests { class RabbitAutoConfigurationTests {

Loading…
Cancel
Save