[RabbitMQ][cinder] Listen to messages

Herve Beraud hberaud at redhat.com
Fri Nov 15 10:13:42 UTC 2019


Le ven. 15 nov. 2019 à 10:17, Blom, Merlin, NMU-OI <
merlin.blom at bertelsmann.de> a écrit :

> Hey there,
>
> it seems to me as if ask.openstack.org is down, so I ask my question here:
>
>
>
> I’d like to listen to oslo messages from cinder as I do for neutron and
> octavia to know what is going on.
>
> For me the following code worked for neutron:
>
>
>
> EXCHANGE_NAME = os.getenv('EXCHANGE_NAME', 'neutron')
>
> ROUTING_KEY = os.getenv('ROUTING_KEY', 'notifications.info')
>
> QUEUE_NAME = os.getenv('QUEUE_NAME', 'messaging_queue')
>
> BROKER_URI = os.getenv('BROKER_URI', 'UNDEFINED')
>
> BROKER_PASSWORD = os.getenv('BROKER_PASSWORD', '')
>
>
>
> class Messages(ConsumerMixin):
>
>     def __init__(self, connection):
>
>         self.connection = connection
>
>         return
>
>
>
> def get_consumers(self, consumer, channel):
>
>         exchange = Exchange(EXCHANGE_NAME, type="topic", durable=False)
>
>         queue = Queue(QUEUE_NAME, exchange, routing_key=ROUTING_KEY,
> durable=False, auto_delete=True, no_ack=True)
>
>         return [consumer(queues=[queue], callbacks=[self.on_message])]
>
>
>
>     def on_message(self, body, message):
>
>         try:
>
>             print(message)
>
>         except Exception as e:
>
>             log.info(repr(e))
>
>
>
> if __name__ == "__main__":
>
>     log.info("Connecting to broker {}".format(BROKER_URI))
>
>     with BrokerConnection(hostname=BROKER_URI, userid='messaging',
> password=BROKER_PASSWORD,
>
>                           virtual_host='/'+EXCHANGE_NAME,
>
>                           heartbeat=4, failover_strategy='round-robin') as
> connection:
>
>         Messaging(connection).run()
>
>         BrokerConnection.connection.close()
>
>
>
> But on the cinder vhost (/cinder)
>

Are you sure cinder use a dedicated vhost? I'm notconviced, if I'm right
they all use the default vhost '/'.

I can’t find an exchange that the code is working on. (cinder,
> cinder-backup, …)
>
> I tried using the rabbitmq tracer: https://www.rabbitmq.com/firehose.html
>
> And got all the cinder messages but I don’t want to use it in production
> because of performance issues.
>
>
>
> Does anyone have an idea how to find the correct exchange for the
> notification info queue in cinder?
>
>
>
> Cheers,
>
> Merlin
>


-- 
Hervé Beraud
Senior Software Engineer
Red Hat - Openstack Oslo
irc: hberaud
-----BEGIN PGP SIGNATURE-----

wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+
Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+
RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP
F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G
5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g
glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw
m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ
hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0
qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y
F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3
B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O
v6rDpkeNksZ9fFSyoY2o
=ECSj
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20191115/69d794db/attachment.html>


More information about the openstack-discuss mailing list