Prevent Messaging to resend failed notifications

Infinite retrying to send notification may cause osprofiler to block, if
transport is not configured correctly. So the easiest way to avoid this sort
of blocks is to set retry=0 at notifier configuration.

Change-Id: I5a4b75905dc8d63b612e193805bae28616e425a7
This commit is contained in:
uppi 2014-07-13 17:21:10 +04:00
parent 2a0300dc07
commit dbe49d142b
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ class Messaging(base.Notifier):
self.service = service
self.notifier = messaging.Notifier(
transport, publisher_id=host, driver="messaging", topic="profiler")
transport, publisher_id=host, driver="messaging",
topic="profiler", retry=0)
def notify(self, info, context=None):
"""Send notifications to Ceilometer via oslo.messaging notifier API.

View File

@ -34,7 +34,8 @@ class MessagingTestCase(test.TestCase):
transport, project, service, host)
messaging.Notifier.assert_called_once_with(
transport, publisher_id=host, driver="messaging", topic="profiler")
transport, publisher_id=host, driver="messaging",
topic="profiler", retry=0)
info = {
"a": 10