You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Gordon Sim <gs...@redhat.com> on 2007/02/06 18:03:22 UTC

Default virtual host (was Re: svn commit: r504087)

Marnie McCormack wrote:
> I think we'd need to define a default though ? There are three vh's in the
> java broker cfg at the moment.

Can the default not be the empty string?

RE: Default virtual host (was Re: svn commit: r504087)

Posted by Tomas Restrepo <to...@devdeo.com>.
Robert,

> To be completely clear, for the "default" virtual host, are we talking
> about
> 
> i) A virtual host with name "", completely separate from all other virtual
> hosts
> 
> or
> 
> ii) A mapping from one of the specified named virtual hosts to the default
> "" name (i.e. the same virtaul host is addressed by multiple names).
> 
> Option i) is anaologous to the default exchange I think.  Option ii) is
> more
> like what you expect in Apache HTTPD type config (where you can map many
> names to the same virtual host).
> 
> I prefer ii) but i) is more "AMQP" ...

>From a pragmatic point of view, either option would appear exactly the same
to the client in general terms (I think), so it really could be something
decided by the implementation (and not necessarily explicitly defined by the
spec).

That said, I personally prefer option ii) as well, because if there ever
comes a time where more stuff is attached to the virtual host than just a
name, it would be simpler to support, I think.


Tomas Restrepo
tomas.restrepo@devdeo.com
http://www.winterdom.com/weblog/





Re: Default virtual host (was Re: svn commit: r504087)

Posted by Marnie McCormack <ma...@googlemail.com>.
I agree - the vh is incidental to the queues-at-broker-startup definition.
It's just the only thing I know of where users really 'see' vhs apart from
connection urls :-)

M


On 2/8/07, Gordon Sim <gs...@redhat.com> wrote:
>
> Marnie McCormack wrote:
> > I guess it boils down to how users will utilise the virtual hosts. At
> > present, the only *really* useful feature around virtual hosts (afaik)
> is
> > the ability to create queues/topics to be created on broker startup -
> the
> > real purpose of virtualhosts.xml on the java broker side.
>
> That's not really a feature of virtual hosts per se though is it? The
> only thing they bring is effectively separate namespaces for queues and
> exchanges so an exchange in one virtual host with a given name is a
> different instance from an exchange with the same name in another
> virtual host.
>
> > I just thought that an empty string is a little confusing in terms of a
> > 'name' for a virtual host. Would be nicer imho to mark a defined vh as
> > default in the config.xml and use that where no vh specified on the
> > connection url ?
>
> That would be fine with me. As Tomas pointed out there will not be a
> great deal of difference between the two options from a clients
> perspective. The only issue is that a client using the default virtual
> host by name and a client not specifying one are actually sharing the
> namespace. I don't think that is a big problem myself.
>

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Gordon Sim <gs...@redhat.com>.
Marnie McCormack wrote:
> I guess it boils down to how users will utilise the virtual hosts. At
> present, the only *really* useful feature around virtual hosts (afaik) is
> the ability to create queues/topics to be created on broker startup - the
> real purpose of virtualhosts.xml on the java broker side.

That's not really a feature of virtual hosts per se though is it? The 
only thing they bring is effectively separate namespaces for queues and 
exchanges so an exchange in one virtual host with a given name is a 
different instance from an exchange with the same name in another 
virtual host.

> I just thought that an empty string is a little confusing in terms of a
> 'name' for a virtual host. Would be nicer imho to mark a defined vh as
> default in the config.xml and use that where no vh specified on the
> connection url ?

That would be fine with me. As Tomas pointed out there will not be a 
great deal of difference between the two options from a clients 
perspective. The only issue is that a client using the default virtual 
host by name and a client not specifying one are actually sharing the 
namespace. I don't think that is a big problem myself.

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Robert Greig <ro...@gmail.com>.
On 08/02/07, Marnie McCormack <ma...@googlemail.com> wrote:

> I just thought that an empty string is a little confusing in terms of a
> 'name' for a virtual host. Would be nicer imho to mark a defined vh as
> default in the config.xml and use that where no vh specified on the
> connection url ?

I think that is the best approach, and it fits with the web server
analogy (for what that's worth).

RG

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Marnie McCormack <ma...@googlemail.com>.
I guess it boils down to how users will utilise the virtual hosts. At
present, the only *really* useful feature around virtual hosts (afaik) is
the ability to create queues/topics to be created on broker startup - the
real purpose of virtualhosts.xml on the java broker side.

I just thought that an empty string is a little confusing in terms of a
'name' for a virtual host. Would be nicer imho to mark a defined vh as
default in the config.xml and use that where no vh specified on the
connection url ?

Marnie



On 2/6/07, Robert Godfrey <ro...@gmail.com> wrote:
>
> > From a pragmatic point of view, either option would appear exactly the
> > same
> > to the client in general terms (I think), so it really could be
> something
> > decided by the implementation (and not necessarily explicitly defined by
> > the
> > spec).
>
>
>
> As long as all clients were set up the same way... if some were using ""
> and
> some were using  <actualname>, then obviously the beviour would be
> different
> in the two cases.
>
> That said, I personally prefer option ii) as well, because if there ever
> > comes a time where more stuff is attached to the virtual host than just
> a
> > name, it would be simpler to support, I think.
>
>
>
> I think the issue is that the whole purpose of virtual hosts is somewhat
> unclear.  I think the general idea is to be along the same lines as
> virtual
> hosts in an http server, so the virtual host might well be seen as
> something
> like the dns name or ip address + port that the client knows the server as
> (before proxying etc).  In that case there is very likely the case where
> you
> want to map many names to a single virtual host... however in this
> scenario
> you would very definitely also want the client to be populating the
> virtual
> hosts parameter on every connection open.
>
> -- Rob
>

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Robert Godfrey <ro...@gmail.com>.
> From a pragmatic point of view, either option would appear exactly the
> same
> to the client in general terms (I think), so it really could be something
> decided by the implementation (and not necessarily explicitly defined by
> the
> spec).



As long as all clients were set up the same way... if some were using "" and
some were using  <actualname>, then obviously the beviour would be different
in the two cases.

That said, I personally prefer option ii) as well, because if there ever
> comes a time where more stuff is attached to the virtual host than just a
> name, it would be simpler to support, I think.



I think the issue is that the whole purpose of virtual hosts is somewhat
unclear.  I think the general idea is to be along the same lines as virtual
hosts in an http server, so the virtual host might well be seen as something
like the dns name or ip address + port that the client knows the server as
(before proxying etc).  In that case there is very likely the case where you
want to map many names to a single virtual host... however in this scenario
you would very definitely also want the client to be populating the virtual
hosts parameter on every connection open.

-- Rob

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Robert Godfrey <ro...@gmail.com>.
Yes - I agree... empty string is better.  Indeed I would go so far as to say
the spec should be changed to remove the need for a leading forward-slash in
a virtual host name (it is just a wasted-byte!).  Banning forward slashes
altogether from the name would be even better :-)

To be completely clear, for the "default" virtual host, are we talking about

i) A virtual host with name "", completely separate from all other virtual
hosts

or

ii) A mapping from one of the specified named virtual hosts to the default
"" name (i.e. the same virtaul host is addressed by multiple names).

Option i) is anaologous to the default exchange I think.  Option ii) is more
like what you expect in Apache HTTPD type config (where you can map many
names to the same virtual host).

I prefer ii) but i) is more "AMQP" ...

- Rob

On 06/02/07, Gordon Sim <gs...@redhat.com> wrote:
>
> Alan Conway wrote:
> > I'll JIRA for the C++ client to default to the empty string, unless
> > someone knows why "/" is a reasonable default for a virtual host name.
>
> Once upon a time the AMQP spec stated that all virtual hosts had to
> start with a '/' and that all brokers should support '/' (the default)
> and '/sandbox' (for conformance testing!).
>
> That is by way of background explanation only and is no longer the case.
> I agree that the empty string is better.
>

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Gordon Sim <gs...@redhat.com>.
Alan Conway wrote:
> I'll JIRA for the C++ client to default to the empty string, unless
> someone knows why "/" is a reasonable default for a virtual host name.

Once upon a time the AMQP spec stated that all virtual hosts had to 
start with a '/' and that all brokers should support '/' (the default) 
and '/sandbox' (for conformance testing!).

That is by way of background explanation only and is no longer the case. 
I agree that the empty string is better.

Re: Default virtual host (was Re: svn commit: r504087)

Posted by Alan Conway <ac...@redhat.com>.
On Tue, 2007-02-06 at 17:35 +0000, Gordon Sim wrote:
> Tomas Restrepo wrote:
> > It sounds to me like what people might want is to have the broker
> > configuration specify which of the configured virtual hosts will be the
> > default. That way, if the client doesn't specify a virtual host during
> > connection, it gets attached to whatever was configured as the default host.
> > No?
> 
> That sounds like a good idea to me. From an interoperability pov I just 
> don't want to have to configure clients and brokers to explicitly use a 
> specific virtual host even in cases where they don't need them. Using an 
> empty string in the client when it doesn't care seems nice and easy.

That's consistent with the strategy for exchanges - there's the
"nameless" default exchange for publishes with an empty exchange name.

I'll JIRA for the C++ client to default to the empty string, unless
someone knows why "/" is a reasonable default for a virtual host name.



Re: Default virtual host (was Re: svn commit: r504087)

Posted by Gordon Sim <gs...@redhat.com>.
Tomas Restrepo wrote:
> It sounds to me like what people might want is to have the broker
> configuration specify which of the configured virtual hosts will be the
> default. That way, if the client doesn't specify a virtual host during
> connection, it gets attached to whatever was configured as the default host.
> No?

That sounds like a good idea to me. From an interoperability pov I just 
don't want to have to configure clients and brokers to explicitly use a 
specific virtual host even in cases where they don't need them. Using an 
empty string in the client when it doesn't care seems nice and easy.

RE: Default virtual host (was Re: svn commit: r504087)

Posted by Tomas Restrepo <to...@devdeo.com>.
> Personally I think that's a little confusing, and I *think* we're using
the
> vh name in the env path for BDBStore and certainly for vh config in
> config.xml and virtualhosts.xml. We're providing three vhs in the default
> java broker config.

It sounds to me like what people might want is to have the broker
configuration specify which of the configured virtual hosts will be the
default. That way, if the client doesn't specify a virtual host during
connection, it gets attached to whatever was configured as the default host.
No?


Tomas Restrepo
tomas.restrepo@devdeo.com
http://www.winterdom.com/weblog/




Re: Default virtual host (was Re: svn commit: r504087)

Posted by Marnie McCormack <ma...@googlemail.com>.
Personally I think that's a little confusing, and I *think* we're using the
vh name in the env path for BDBStore and certainly for vh config in
config.xml and virtualhosts.xml. We're providing three vhs in the default
java broker config.

Unless I've misunderstood what you mean ?

M


On 2/6/07, Gordon Sim <gs...@redhat.com> wrote:
>
> Marnie McCormack wrote:
> > I think we'd need to define a default though ? There are three vh's in
> the
> > java broker cfg at the moment.
>
> Can the default not be the empty string?
>