Create notification listener failed in Horizon.

asked 2015-01-22 01:25:27 -0600

Yu gravatar image

Hi all,

I'm now trying to create a notification listener in horizon to get the tenant delete notification(I know this sounds wired). But I got this error when I try to start the listener:

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

And here is my code snippet:

from oslo.config import cfg
from oslo import messaging as oslo_messaging

LOG = logging.getLogger(__name__)


class NotificationEndpoint(object):
    def info(self, ctxt, publisher_id, event_type, payload, metadata):
        LOG.error("@@@event received: %s" % event_type)
        pass

    def warn(self, ctxt, publisher_id, event_type, payload, metadata):
        pass


OPTS = [
    cfg.ListOpt('notification_topics',  
                default=['notifications', ],
                help=_('AMQP topics Keystone sends notifications on')), 
]

cfg.CONF.register_opts(OPTS, group='identity')

transport = oslo_messaging.get_transport(cfg.CONF)
LOG.error("@@@transport is %s" % transport)

targets = [
    oslo_messaging.Target(topic='notifications')
]
endpoints = [
    NotificationEndpoint(),
]

server = oslo_messaging.get_notification_listener(transport, targets,
                                                  endpoints, 'eventlet')
LOG.error("@@@server is %s" % server)

server.start()

what's reason for this problem? Please give me some advice.

Great appreciation for any input.

edit retag flag offensive close merge delete