Skip to content

Commit

Permalink
QPID-8041: Allow virtualhost field to be specified when forming an AM…
Browse files Browse the repository at this point in the history
…QP 0-10 connection.
  • Loading branch information
k-wall committed Nov 17, 2017
1 parent 278da4e commit 5a8b4a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/qpid/messaging/Connection.h
Expand Up @@ -95,6 +95,10 @@ class QPID_MESSAGING_CLASS_EXTERN Connection : public qpid::messaging::Handle<Co
* authentication of the server to the client (and should
* be used only as a last resort)
*
* When AMQP 0-10 is used, the following options apply:
*
* - virtualhost: The name of the virtual host to work with.
*
* When AMQP 1.0 is used, the following options apply:
*
* - container_id: sets the container id to use for the connection
Expand Down
2 changes: 2 additions & 0 deletions src/qpid/client/amqp0_10/ConnectionImpl.cpp
Expand Up @@ -191,6 +191,8 @@ void ConnectionImpl::setOption(const std::string& name, const Variant& value)
amqp_0_10::translate(value.asMap(), settings.clientProperties);
} else if (name == "disable-auto-decode" || name == "disable_auto_decode") {
disableAutoDecode = value;
} else if (name == "virtualhost") {
settings.virtualhost = value.asString();
} else {
throw qpid::messaging::MessagingException(QPID_MSG("Invalid option: " << name << " not recognised"));
}
Expand Down

0 comments on commit 5a8b4a4

Please sign in to comment.