Thank you for your answer!

 

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

 

Indeed it does, when deployed with openstack-ansible.

 

But I found a way to find the exchange with RMQ Tracing:

https://www.rabbitmq.com/firehose.html

 

Using the GUI plugin I’ve got all the messages flowing through the cinder vhost and found:

 

The exchange for the notification.* queues is “openstack” not cinder.

Sometimes I ask myself if there are any kind of standards for RMQ Communication. :P

 

This may be interesting for someone else to use in their projects.

 

Cheers,

Merlin

 

Von: Herve Beraud <hberaud@redhat.com>
Gesendet: Freitag, 15. November 2019 11:14
An: Blom, Merlin, NMU-OI <merlin.blom@bertelsmann.de>
Cc: openstack-discuss@lists.openstack.org
Betreff: Re: [RabbitMQ][cinder] Listen to messages

 

 

 

Le ven. 15 nov. 2019 à 10:17, Blom, Merlin, NMU-OI <merlin.blom@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-----