Allow empty path in AMQP URIs to support using the default vhost.

This commit is contained in:
Scott Frederick
2015-05-11 17:04:29 -05:00
parent 30c40dd0d8
commit 06b9fd1bb4
2 changed files with 14 additions and 8 deletions

View File

@@ -61,15 +61,14 @@ public class AmqpServiceInfo extends UriBasedServiceInfo {
}
String path = uriInfo.getPath();
if (path == null) {
throw new IllegalArgumentException("Missing virtual host in amqp URI: " + uriInfo);
} else {
if (path != null) {
// Check that the path only has a single segment. As we have an authority component
// in the URI, paths always begin with a slash.
if (path.indexOf('/') != -1) {
throw new IllegalArgumentException("Multiple segments in path of amqp URI: " + uriInfo);
}
}
return uriInfo;
}
}