← Back to team overview

openstack team mailing list archive

Re: [Metering] Bootstrapping, first counter implementation

 

On Thu, May 10, 2012 at 3:57 AM, Julien Danjou
<julien.danjou@xxxxxxxxxxxx>wrote:

> On Wed, May 09 2012, Doug Hellmann wrote:
>
> > I'm not sure what you mean. I was able to use nova.service to create a
> > "metering" server and a simple manager that subscribes to the
> notification
> > events. See https://github.com/dhellmann/metering-prototype(metering-test
> > is the main program and testmanager.py is the manager class). I borrowed
> > your Connection code.
>
> Actually, the Service class is supposed to handle the AMQP (or whatever
> backend) connection itself and bind it to a set of topics. But it uses
> the nova.rpc.impl_kombu.Connection class that uses ProxyCallback and
> that one obviously fails to decode notification. This is why I say I
> failed to the Service class.
>
> You cheated since you opened another AMQP connection in your Manager
> class, rendering the connection from the Service class useless. I wish
> we could access the connection from the Service from the Manager so we
> can reuse it at least, but that does not seem possible neither.
>

"Cheated" is a bit harsh. :-)

Yeah, I wanted to use the handle owned by the service, but couldn't get to
it. I thought asking for a connection without specifying that it had to be
a new one would be a work-around. I was surprised that the manager object
wasn't given access to the service so it could subscribe to messages, but I
guess that's supposed to be the Service's job.


>
> On the other hand, even if it's not the cleanest way to do things, I
> kind of like using the Service class so I'll probably grab your code
> anyway. :-)
>

It does give us access to other parts of the framework like logging. And we
may eventually find a need to communicate with the service via RPC.


>
> Thanks Doug,
> --
> Julien Danjou
> // eNovance                      http://enovance.com
> // ✉ julien.danjou@xxxxxxxxxxxx  ☎ +33 1 49 70 99 81
>

References