Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
* @author Gary Russell
* @author Phillip Webb
* @author Artsiom Yudovin
* @author Jonghan Kim
* @since 1.0.0
*/
@Configuration(proxyBeanMethods = false)
Expand All @@ -105,6 +106,7 @@ public CachingConnectionFactory rabbitConnectionFactory(RabbitProperties propert
.getObject());
PropertyMapper map = PropertyMapper.get();
map.from(properties::determineAddresses).to(factory::setAddresses);
map.from(properties::getAddressShuffleMode).whenNonNull().to(factory::setAddressShuffleMode);
map.from(properties::isPublisherReturns).to(factory::setPublisherReturns);
map.from(properties::getPublisherConfirmType).whenNonNull().to(factory::setPublisherConfirmType);
RabbitProperties.Cache.Channel channel = properties.getCache().getChannel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.Optional;

import org.springframework.amqp.core.AcknowledgeMode;
import org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.AddressShuffleMode;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.ConfirmType;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand All @@ -41,6 +42,7 @@
* @author Gary Russell
* @author Artsiom Yudovin
* @author Franjo Zilic
* @author Jonghan Kim
* @since 1.0.0
*/
@ConfigurationProperties(prefix = "spring.rabbitmq")
Expand Down Expand Up @@ -87,6 +89,11 @@ public class RabbitProperties {
*/
private String addresses;

/**
* Shuffling mode for connecting host.
*/
private AddressShuffleMode addressShuffleMode;

/**
* Requested heartbeat timeout; zero for none. If a duration suffix is not specified,
* seconds will be used.
Expand Down Expand Up @@ -282,6 +289,14 @@ public void setVirtualHost(String virtualHost) {
this.virtualHost = "".equals(virtualHost) ? "/" : virtualHost;
}

public AddressShuffleMode getAddressShuffleMode() {
return this.addressShuffleMode;
}

public void setAddressShuffleMode(AddressShuffleMode addressShuffleMode) {
this.addressShuffleMode = addressShuffleMode;
}

public Duration getRequestedHeartbeat() {
return this.requestedHeartbeat;
}
Expand Down