|
|
@ -16,6 +16,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.autoconfigure.amqp;
|
|
|
|
package org.springframework.boot.autoconfigure.amqp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.LinkedHashSet;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
@ -78,8 +81,8 @@ public class RabbitProperties {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String parseAddresses(String addresses) {
|
|
|
|
private String parseAddresses(String addresses) {
|
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
|
Set<String> result = new LinkedHashSet<String>();
|
|
|
|
for (String address : StringUtils.commaDelimitedListToSet(addresses)) {
|
|
|
|
for (String address : StringUtils.commaDelimitedListToStringArray(addresses)) {
|
|
|
|
address = address.trim();
|
|
|
|
address = address.trim();
|
|
|
|
if (address.startsWith("amqp://")) {
|
|
|
|
if (address.startsWith("amqp://")) {
|
|
|
|
address = address.substring("amqp://".length());
|
|
|
|
address = address.substring("amqp://".length());
|
|
|
@ -99,15 +102,12 @@ public class RabbitProperties {
|
|
|
|
this.virtualHost = address.substring(index + 1);
|
|
|
|
this.virtualHost = address.substring(index + 1);
|
|
|
|
address = address.substring(0, index);
|
|
|
|
address = address.substring(0, index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (result.length() > 0) {
|
|
|
|
|
|
|
|
result.append(",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!address.contains(":")) {
|
|
|
|
if (!address.contains(":")) {
|
|
|
|
address = address + ":" + this.port;
|
|
|
|
address = address + ":" + this.port;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.append(address);
|
|
|
|
result.add(address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result.length() > 0 ? result.toString() : null;
|
|
|
|
return result.isEmpty() ? null : StringUtils.collectionToCommaDelimitedString(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setPort(int port) {
|
|
|
|
public void setPort(int port) {
|
|
|
|