8000 Issue #42: AMQConnection missing "/" for non-default virtual hosts. · panchenko/rabbitmq-java-client@f3689e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3689e3

Browse files
committed
Issue rabbitmq#42: AMQConnection missing "/" for non-default virtual hosts.
If the virtual host is not the default virtual host, then there needs to be a separator between the port and the name of the virtual host. -=david=-
1 parent 4ccacf4 commit f3689e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/com/rabbitmq/client/impl/AMQConnection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ public AMQCommand transformReply(AMQCommand command) {
862862
}
863863

864864
@Override public String toString() {
865-
return 5549 "amqp://" + this.username + "@" + getHostAddress() + ":" + getPort() + _virtualHost;
865+
final String virtualHost = "/".equals(_virtualHost) ? _virtualHost : "/" + _virtualHost;
866+
return "amqp://" + this.username + "@" + getHostAddress() + ":" + getPort() + virtualHost;
866867
}
867868

868869
private String getHostAddress() {

0 commit comments

Comments
 (0)
0