<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 3:57 AM, Julien Danjou <span dir="ltr"><<a href="mailto:julien.danjou@enovance.com" target="_blank">julien.danjou@enovance.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 Wed, May 09 2012, Doug Hellmann wrote:<br>
<br>
> I'm not sure what you mean. I was able to use nova.service to create a<br>
> "metering" server and a simple manager that subscribes to the notification<br>
> events. See <a href="https://github.com/dhellmann/metering-prototype" target="_blank">https://github.com/dhellmann/metering-prototype</a> (metering-test<br>
> is the main program and testmanager.py is the manager class). I borrowed<br>
> your Connection code.<br>
<br>
</div>Actually, the Service class is supposed to handle the AMQP (or whatever<br>
backend) connection itself and bind it to a set of topics. But it uses<br>
the nova.rpc.impl_kombu.Connection class that uses ProxyCallback and<br>
that one obviously fails to decode notification. This is why I say I<br>
failed to the Service class.<br>
<br>
You cheated since you opened another AMQP connection in your Manager<br>
class, rendering the connection from the Service class useless. I wish<br>
we could access the connection from the Service from the Manager so we<br>
can reuse it at least, but that does not seem possible neither.<br></blockquote><div><br></div><div>"Cheated" is a bit harsh. :-)</div><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On the other hand, even if it's not the cleanest way to do things, I<br>
kind of like using the Service class so I'll probably grab your code<br>
anyway. :-)<br></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Thanks Doug,<br>
<div class="HOEnZb"><div class="h5">--<br>
Julien Danjou<br>
// eNovance                      <a href="http://enovance.com" target="_blank">http://enovance.com</a><br>
// ✉ <a href="mailto:julien.danjou@enovance.com">julien.danjou@enovance.com</a>  ☎ <a href="tel:%2B33%201%2049%2070%2099%2081" value="+33149709981">+33 1 49 70 99 81</a><br>
</div></div></blockquote></div><br>