|
|
@ -189,7 +189,7 @@ public class RabbitProperties {
|
|
|
|
private List<Address> parseAddresses(String addresses) {
|
|
|
|
private List<Address> parseAddresses(String addresses) {
|
|
|
|
List<Address> parsedAddresses = new ArrayList<>();
|
|
|
|
List<Address> parsedAddresses = new ArrayList<>();
|
|
|
|
for (String address : StringUtils.commaDelimitedListToStringArray(addresses)) {
|
|
|
|
for (String address : StringUtils.commaDelimitedListToStringArray(addresses)) {
|
|
|
|
parsedAddresses.add(new Address(address));
|
|
|
|
parsedAddresses.add(new Address(address, getSsl().isEnabled()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return parsedAddresses;
|
|
|
|
return parsedAddresses;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -390,7 +390,7 @@ public class RabbitProperties {
|
|
|
|
return isEnabled();
|
|
|
|
return isEnabled();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Address address = RabbitProperties.this.parsedAddresses.get(0);
|
|
|
|
Address address = RabbitProperties.this.parsedAddresses.get(0);
|
|
|
|
return address.secureConnection;
|
|
|
|
return address.determineSslEnabled(isEnabled());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
|
|
public void setEnabled(boolean enabled) {
|
|
|
@ -989,14 +989,14 @@ public class RabbitProperties {
|
|
|
|
|
|
|
|
|
|
|
|
private String virtualHost;
|
|
|
|
private String virtualHost;
|
|
|
|
|
|
|
|
|
|
|
|
private boolean secureConnection;
|
|
|
|
private Boolean secureConnection;
|
|
|
|
|
|
|
|
|
|
|
|
private Address(String input) {
|
|
|
|
private Address(String input, boolean sslEnabled) {
|
|
|
|
input = input.trim();
|
|
|
|
input = input.trim();
|
|
|
|
input = trimPrefix(input);
|
|
|
|
input = trimPrefix(input);
|
|
|
|
input = parseUsernameAndPassword(input);
|
|
|
|
input = parseUsernameAndPassword(input);
|
|
|
|
input = parseVirtualHost(input);
|
|
|
|
input = parseVirtualHost(input);
|
|
|
|
parseHostAndPort(input);
|
|
|
|
parseHostAndPort(input, sslEnabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String trimPrefix(String input) {
|
|
|
|
private String trimPrefix(String input) {
|
|
|
@ -1005,7 +1005,8 @@ public class RabbitProperties {
|
|
|
|
return input.substring(PREFIX_AMQP_SECURE.length());
|
|
|
|
return input.substring(PREFIX_AMQP_SECURE.length());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (input.startsWith(PREFIX_AMQP)) {
|
|
|
|
if (input.startsWith(PREFIX_AMQP)) {
|
|
|
|
input = input.substring(PREFIX_AMQP.length());
|
|
|
|
this.secureConnection = false;
|
|
|
|
|
|
|
|
return input.substring(PREFIX_AMQP.length());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return input;
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1036,11 +1037,11 @@ public class RabbitProperties {
|
|
|
|
return input;
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void parseHostAndPort(String input) {
|
|
|
|
private void parseHostAndPort(String input, boolean sslEnabled) {
|
|
|
|
int portIndex = input.indexOf(':');
|
|
|
|
int portIndex = input.indexOf(':');
|
|
|
|
if (portIndex == -1) {
|
|
|
|
if (portIndex == -1) {
|
|
|
|
this.host = input;
|
|
|
|
this.host = input;
|
|
|
|
this.port = (this.secureConnection) ? DEFAULT_PORT_SECURE : DEFAULT_PORT;
|
|
|
|
this.port = (determineSslEnabled(sslEnabled)) ? DEFAULT_PORT_SECURE : DEFAULT_PORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
this.host = input.substring(0, portIndex);
|
|
|
|
this.host = input.substring(0, portIndex);
|
|
|
@ -1048,6 +1049,10 @@ public class RabbitProperties {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean determineSslEnabled(boolean sslEnabled) {
|
|
|
|
|
|
|
|
return (this.secureConnection != null) ? this.secureConnection : sslEnabled;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|