Ask Your Question
0

Notification Listener using Oslo Client

asked 2014-10-16 05:58:12 -0500

chitranshi-shubham gravatar image

Hello,

I want to create a notification listener that connects to the Oslo bus and retrieves all the messages passed on by different modules. Currently I am using pika Client for RabbitMQ to listen to the notification. here is the code snippet

queue_name = "name"
credentials = pika.PlainCredentials("username", "password")
connection = pika.blockingConnection(pika.connectionParameters(host = "hostname", credentials = credentials))

def callback(ch,method,properties,body)
# do stuff

channel.basic_consume(callback,queue = queue_name,no_ack = True)

channel.start_consuming()

but this only works for RabbitMQ, I want to use Oslo Client to do the same. How can I do that using Oslo Libraries. A simple code snippet can be helpful.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-10-16 13:04:08 -0500

edit flag offensive delete link more

Comments

hey haneef, thanks for the quick reply.. but now I am getting an error

No handler could be found for the logger "oslo.messaging._drivers.impl_rabbit"

any solution to that.?

chitranshi-shubham gravatar imagechitranshi-shubham ( 2014-10-20 01:19:45 -0500 )edit

oh I added a logger (logging.basicConfig()) it shows the error now .. the problem now is that it is unable to log in the amqp server. I tried changing the cfg.CONF[rabbit_password], but that didnt help. any idea ?

chitranshi-shubham gravatar imagechitranshi-shubham ( 2014-10-20 01:43:35 -0500 )edit

What is the exact error? Default CONF values should work If you haven't changed anything

rabbit_host=localhost rabbit_port=5672 rabbit_userid=guest rabbit_password=guest

Haneef Ali gravatar imageHaneef Ali ( 2014-10-20 12:14:55 -0500 )edit

sorry for the delay. I was able to get a workaround for that (passed the url), but the simple notification listener code is creating queues with names *.warn, *.error, that gives me nothing. did this code work for you? can you share a sample snippet (maybe just listening to nova specific queues)

chitranshi-shubham gravatar imagechitranshi-shubham ( 2014-10-30 00:33:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-10-16 05:58:12 -0500

Seen: 600 times

Last updated: Oct 16 '14