Add priority based queues to notifications.

Remove duplicate json encoding in notifier (rpc.cast does encoding... ) 
make no_op_notifier  match rabbit one for signature on notify()
This commit is contained in:
Monsyne Dragon
2011-05-10 23:29:16 +00:00
parent ab016fa19b
commit de784972a1
4 changed files with 30 additions and 13 deletions

View File

@@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
import nova.context
@@ -28,10 +27,12 @@ flags.DEFINE_string('notification_topic', 'notifications',
class RabbitNotifier(object):
"""Sends notifications to a specific RabbitMQ server and topic"""
pass
def notify(self, payload):
"""Sends a notification to the RabbitMQ"""
context = nova.context.get_admin_context()
topic = FLAGS.notification_topic
priority = payload.get('priority',
FLAGS.default_notification_level)
priority = priority.lower()
topic = '%s.%s' % (FLAGS.notification_topic, priority)
rpc.cast(context, topic, payload)