In my view a cell should only know about the queue it's connected to, and let the 'global' message queue to do its job of dispatching the messages to the right recipient: that would solve the problem altogether.<div>
<div><br></div><div>Were <a href="http://www.rabbitmq.com/federation.html">federated</a> queues and topic <a href="http://blog.springsource.org/2011/04/01/routing-topologies-for-performance-and-scalability-with-rabbitmq/">routing</a> not considered fit for the purpose? I guess the drawback with this is that it is tight to Rabbit.</div>
<div><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 2:14 AM, Mark McLoughlin <span dir="ltr"><<a href="mailto:markmc@redhat.com" target="_blank">markmc@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 2013-06-14 at 12:41 -0700, Chris Behrens wrote:<br>
> On Jun 13, 2013, at 11:26 PM, Mark McLoughlin <<a href="mailto:markmc@redhat.com">markmc@redhat.com</a>> wrote:<br>
><br>
> > Is there any reason not to just put it in nova.conf as transport URLs?<br>
> ><br>
> > (By nova.conf, I mean cfg.CONF for nova which means you could happily do<br>
> > e.g. --config-file nova-cells.conf too)<br>
><br>
> The issue with using cfg.CONF is that we need the same config options<br>
> for each cell. So, I guess you'd have to dynamically create the<br>
> config groups with cell name as the group name… and have some sort of<br>
> global option or an option in a different config group that specifies<br>
> the list of cells. I think it just gets kinda nasty. But let me know<br>
> if I'm missing a good way to do it. It seems like JSON is going to be<br>
> a little more flexible. :)<br>
<br>
</div>I don't know whether I like it yet or not, but here's how it might look:<br>
<br>
[cells]<br>
parents = parent1<br>
children = child1, child2<br>
<br>
[cell:parent1]<br>
transport_url = qpid://host1/nova<br>
<br>
[cell:child1]<br>
transport_url = qpid://host2/child1_nova<br>
<br>
[cell:child2]<br>
transport_url = qpid://host2/child2_nova<br>
<br>
Code for parsing that is:<br>
<br>
from oslo.config import cfg<br>
<br>
cells_opts = [<br>
cfg.ListOpt('parents', default=[]),<br>
cfg.ListOpt('children', default=[]),<br>
]<br>
<br>
cell_opts = [<br>
cfg.StrOpt('api_url'),<br>
cfg.StrOpt('transport_url'),<br>
cfg.FloatOpt('weight_offset', default=0.0),<br>
cfg.FloatOpt('weight_scale', default=1.0),<br>
]<br>
<br>
conf = cfg.CONF<br>
conf(['--config-file=cells.conf'])<br>
conf.register_opts(cells_opts, group='cells')<br>
<br>
def get_cell(conf, name):<br>
group_name = 'cell:' + name<br>
conf.register_opts(cell_opts, group=group_name)<br>
return conf[group_name]<br>
<br>
for cell in conf.cells.parents + conf.cells.children:<br>
print cell, get_cell(conf, cell).items()<br>
<br>
<br>
Ok ... I think I do like it :)<br>
<br>
Cheers,<br>
Mark.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>