[RabbitMQ][cinder] Listen to messages
Blom, Merlin, NMU-OI
merlin.blom at bertelsmann.de
Fri Nov 15 09:13:20 UTC 2019
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)
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>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20191115/a12d0feb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5195 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20191115/a12d0feb/attachment-0001.bin>
More information about the openstack-discuss
mailing list