Skip to content

Commit

Permalink
Properly parse vhost from connection url
Browse files Browse the repository at this point in the history
  • Loading branch information
tkral committed Sep 12, 2011
1 parent 9d8ed86 commit 465f155
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/play/modules/rabbitmq/RabbitMQPlugin.java
Expand Up @@ -72,7 +72,10 @@ public void onApplicationStart() {

Play.configuration.setProperty("rabbitmq.host", rabbitmqUri.getHost());
Play.configuration.setProperty("rabbitmq.port", Integer.toString(rabbitmqUri.getPort()));
Play.configuration.setProperty("rabbitmq.vhost", rabbitmqUri.getPath());

if (rabbitmqUri.getPath().length() > 1) {
Play.configuration.setProperty("rabbitmq.vhost", rabbitmqUri.getPath().substring(1));
}

if (rabbitmqUri.getUserInfo() != null) {
String[] rabbitmqUserInfo = rabbitmqUri.getUserInfo().split(":");
Expand Down

0 comments on commit 465f155

Please sign in to comment.