371 Commits

Author SHA1 Message Date
Mark McLoughlin
8060878b5b notify listener: document the metadata callback parameter
Add some details about what the metadata parameter contains.

Change-Id: I191c1c480c679534c1dede9aa85c51615faf0800
2014-03-03 09:43:21 -08:00
Mehdi Abaakouk
ed2a1545c0 Add missing data into the notif. endpoint callback
Some information about the notification (ie: message_id and timestamp)
are currently not available for the application.

This change add them.

Partial implements blueprint notification-subscriber-server

Change-Id: I83e562725205fb270f6065fe1118c3c9865b2294
2014-03-03 17:33:41 +01:00
Mehdi Abaakouk
71ac681a73 Add multiple exchange per listerner in fake driver
This patch allow the FakeListener to listen on multiple FakeExchange.

Partial implements blueprint notification-subscriber-server

Change-Id: I9830cc01efdd931f6628853f7e84b947d7b855c9
2014-03-03 09:27:57 +01:00
Mehdi Abaakouk
d8d2ad95d7 Allow to requeue the notification message
This patch allow to requeue the notification received by the
notification listener.

Partial implements blueprint notification-subscriber-server

Change-Id: I49c4ba91224c280e479edb19289ccb337a2ab843
2014-03-03 09:27:57 +01:00
OpenStack Jenkins
35f6d588a3 Updated from global requirements
Change-Id: Iddf9be2b384f9c0871a2baf59e94ec5201ca37c6
2014-02-28 08:00:27 +00:00
Jeremy Hanmer
fb453e4f08 Convert to oslo.test
bp graduate-oslo-test

Change-Id: Iff1eebac011dab26468a7f1475b5c36b0bb2a7d2
2014-02-26 17:06:03 -08:00
Jenkins
7564e2cf47 Merge "User a more accurate max_delay for reconnects" 2014-02-26 02:14:30 +00:00
Jenkins
9bf03ad506 Merge "Add a link to the docs from the README" 2014-02-25 17:17:20 +00:00
Jenkins
14e3aeb3da Merge "Add log_handler to oslo.messaging" 2014-02-25 16:51:54 +00:00
Jenkins
e9821fe602 Merge "Improve help strings" 2014-02-25 12:40:18 +00:00
Lance Bragstad
78ff56e170 Add log_handler to oslo.messaging
Move log_handler from oslo-incubator to oslo.messaging and include
unit tests. This patch also adds an additional test case from the
original version in oslo-incubator. Originally, the test case only
checked to make sure the notification was not sent. Now a positive test
case exists to test both paths.

bp graduate-notifier-log-handler
Co-Authored By: Ben Nemec <bnemec@redhat.com>

Change-Id: I9ea051ec7e3614579341a31d8dc1c13d9514b8a9
2014-02-21 22:41:37 +00:00
kgriffs
5f2d8330b4 Add a link to the docs from the README
Newcomers often struggle to find the docs for Oslo libraries. Let's
help them out a little.

Change-Id: I68cb214ad117ff1c45e83df302f37dba485147f6
2014-02-19 14:07:58 -06:00
Xavier Queralt
8a3744fe05 Pass the session to QpidMessage constructor
The patch in I6e37780cc28737cfd56b6719ec8d9cebbc9bb278 added a new class
for the QpidMessage which was wrongly initialized when processing a
message.

Change-Id: Iaf525fc6ee9e56100c89863f9c651f20c148ecb5
Closes-Bug: 1282038
2014-02-19 12:15:29 +01:00
Flavio Percoco
dc1f984dac User a more accurate max_delay for reconnects
In an HA deployment, a 60 seconds delay between reconnects can be quite
problematic. This patch changes the delay calculation by setting the max
delay to 5s and by changing the way it is increased.

Unfortunately, this is one of the places where both our main drivers are
not consistent. Rabbit's driver uses configuration parameters for this
whereas qpid's driver has never had one. However, I would prefer not
adding configuration paremeters to qpid's driver for the following
reasons:

    1. Most of OpenStack services depend on the messaging layer, hence
    they need it to be available. A 5s delay seems to be reasonable and
    I could argue the need of tune it further. Although so frequent
    reconnects can add load to the network, that wouldn't be the main
    issue if one of the brokers go down.
    2. We're trying to move away from configuration options towards using
    transport URL. This path is still not clear and I would
    prefer avoiding adding new options until we clear it out.

Change-Id: I537015f452eb770acba41fdedfe221628f52a920
Closes-bug: #1281148
2014-02-18 10:56:21 +01:00
Mehdi Abaakouk
e785a5d994 Make the dispatcher responsible of the message ack
This patch make the dispatcher responsible of the message
acknowledgement.

This is the preliminar step to be able to requeue message.

Partial implements blueprint notification-subscriber-server

Change-Id: If74b47d5e23976d407deb27df7395b1982963c75
2014-02-18 08:31:30 +01:00
Mehdi Abaakouk
8a644c1166 Don't reply to notification message
The notification listener doesn't have anything to send to the notifier
and the notifier doesn't attend to receive something.

So this patch remove the message reply when the listener is a
notification
listener.

Partial implements blueprint notification-subscriber-server

Change-Id: Ic989947ba3b6894cde788422842fca19159ea261
2014-02-18 08:31:30 +01:00
Jenkins
7473d18ebe Merge "Abstract the acknowledge layer of a message" 2014-02-17 16:39:24 +00:00
Jenkins
15bfa35e0c Merge "Implements notification listener and dispatcher" 2014-02-17 16:33:42 +00:00
Mehdi Abaakouk
0d102aa361 Abstract the acknowledge layer of a message
The patch add ta abstraction layer to acknowledge a message.

Partial implements blueprint notification-subscriber-server

Change-Id: I6e37780cc28737cfd56b6719ec8d9cebbc9bb278
2014-02-14 16:06:26 +01:00
Mehdi Abaakouk
9f58e2c3fe Implements notification listener and dispatcher
This patch allows to quickly create a listener to receive
notification messages.

Example of the api:

class Endpoint(object):
    def warn(self, ctxt, publisher_id, event_type, payload):
        do_something(payload)

target = messaging.Target(topic='notifications', exchange='cinder')
listener = notify.get_notification_listener(transport, [target],
                                            [Endpoint()],
                                            executor,
                                            serializer)

Implements blueprint notification-subscriber-server

Change-Id: I434bc487c382a2048670df726d9bebd640150bb9
2014-02-14 16:06:26 +01:00
Dirk Mueller
de6d92fb92 Switch over to oslosphinx
Having the sphinx theme in the same namespace package
as the production code has been causing issues with
devstack installations. The solution settled on was
to rename oslo.sphinx to oslosphinx because oslo.sphinx
is not a "production" library.

See the linked bug report for more background details.

Closes-Bug: #1277168
Change-Id: I220b8901cef36499e91b92719f1e8e5461a95e92
2014-02-14 10:09:13 +00:00
Jenkins
70dbe6a7cc Merge "Update ExpectedException handling" 2014-02-11 15:52:25 +00:00
Jenkins
5a48b027a0 Merge "RabbitMQ: advance thru the list of brokers on reconnect" 2014-02-10 03:24:47 +00:00
Jenkins
a65f17abbb Merge "Qpid: advance thru the list of brokers on reconnect" 2014-02-10 03:15:11 +00:00
Jenkins
44d38cb15c Merge "Allow different login methods to be used with kombu connections" 2014-02-10 03:15:10 +00:00
Andreas Jaeger
5a860beb87 Improve help strings
Follow oslo.config style guide for help strings better to create
consistent help strings:
* Capitalize first word of each help string
* Finish help strings with "."

Change-Id: Ia08fa09593661e6e5b834d98bbd92689c2674075
2014-02-07 22:25:09 +01:00
Doug Hellmann
7b13bc1888 Update ExpectedException handling
Catch expected exceptions in a way that supports subclasses also being
seen as "expected."

Log a little more detail about unexpected exceptions in the ExecutorBase
so it is easier to add them to the list of expected exceptions.

Change-Id: I1bdd628eba717308f0afe1a889efd8711bad6296
Closes-bug: #1276163
2014-02-05 09:32:42 -08:00
Doug Hellmann
355d15aee3 Ignore any egg and egg-info directories
Running the tests installs pbr in a way that leaves a .egg directory in
the source tree, so update the ignore file to ignore it.

Change-Id: I7d702c9511992efc518195def0967bc0191d93a9
2014-02-05 09:32:25 -08:00
Ihar Hrachyshka
3fdd52e0d4 Qpid: advance thru the list of brokers on reconnect
In Qpid implementation, when using multiple qpid_hosts, we don't want to
immediately retry failed connection for the same failed broker. This was not
the case in existing implementation though, where we've always attempted to
reconnect starting from the first broker in the list of candidates. So if the
first broker failed, we initiated reconnect to the same failed broker.

This change makes reconnect() implementation to select the next broker in the
list. This also means that non-failure reconnect attempts will also switch the
current broker. All in all, users should not rely on any particular order to
use brokers from the list, so this should not constitute an issue.

Change-Id: I257c2ad6d7ebead356c0239134340975da6dbc07
Partial-Bug: 1261631
2014-02-05 15:30:55 +01:00
Ihar Hrachyshka
71c6866471 RabbitMQ: advance thru the list of brokers on reconnect
In RabbitMQ implementation, when using multiple rabbit_hosts, we don't want to
immediately retry failed connection for the same failed broker. This was not
the case in existing implementation though, where we've always attempted to
reconnect starting from the first broker in the list of candidates. So if the
first broker failed, we initiated reconnect to the same failed broker.

This change makes reconnect() implementation to select the next broker in the
list. This also means that non-failure reconnect attempts will also switch the
current broker. All in all, users should not rely on any particular order to
use brokers from the list, so this should not constitute an issue.

Change-Id: I76965ea06c1fb6fd0cd384a5b3edc14703470b8f
Partial-Bug: 1261631
2014-02-05 15:28:33 +01:00
Jenkins
84298bd041 Merge "Make the dispatcher responsible to listen()" 2014-02-04 21:01:15 +00:00
Jenkins
286ac38905 Merge "Allow fake driver to consume multiple topics" 2014-02-04 21:01:13 +00:00
Jenkins
bf3896d462 Merge "Remove unused eventlet/greenlet from qpid/rabbit" 2014-02-04 20:25:32 +00:00
Jenkins
39ac6d37fe Merge "Fix UnboundLocalError error" 2014-02-01 10:54:57 +00:00
Jenkins
f1188307b6 Merge "Use stevedore's make_test_instance" 2014-02-01 02:55:21 +00:00
Mehdi Abaakouk
86e5737bf6 Make the dispatcher responsible to listen()
The dispatcher is now responsible to configure and to get the listener from
the transport.

The server just ask to the dispatcher to build and return a configured
listener for a provider transport.

Partial implements blueprint notification-subscriber-server

Change-Id: I4a6d9620b8239f6d377bc5788b8a90a860b2f02c
2014-01-30 13:40:42 +01:00
Mehdi Abaakouk
11a90eabc9 Allow fake driver to consume multiple topics
This patch allow the fake driver to comsume multiple topics
with one listener.

Partial implements blueprint notification-subscriber-server

Change-Id: Ib52dc181e10b487854fbb398eda9f758232a1251
2014-01-30 13:40:42 +01:00
Joe Harrison
98454aaf86 Allow different login methods to be used with kombu connections
Currently it is not possible to modify the login method used with
kombu connections via configuration files, and requires modifying
the source code to actually add a login method in the first place.
This adds a configuration option (and default) which are passed
along to the kombu connection.

RabbitMQ allows three login method strings by default, but server
side plugins allow arbitrarily named strings to be used as login
methods and as such it is not possible to provide a fixed list of
options to the user.

DocImpact

Change-Id: I5c62a8dd4125d42bb429d3985061e37a9d519fff
Closes-Bug: #1269890
2014-01-29 01:11:24 +01:00
Jenkins
f81cde600b Merge "Expose an entry point to list all config options" 2014-01-28 06:17:56 +00:00
Jenkins
f397c4264b Merge "Fix test case name typo" 2014-01-28 06:13:36 +00:00
Doug Hellmann
dd8eb5196f Use stevedore's make_test_instance
Replace the use of TestManager with make_test_instance
to get an instance of the type of manager expected.
The old TestManager class is deprecated

Change-Id: I717c0296bf8ae07b1dad8f0045bfe12c8620ad0a
Partial-bug: #1273455
2014-01-27 19:23:18 -05:00
Jenkins
1d25c5ae20 Merge "Fix help strings" 2014-01-27 21:25:38 +00:00
Mark McLoughlin
0eb5a6f6c7 Expose an entry point to list all config options
Register a oslo.messaging entry point in the oslo.config.opts namespace
which, when called, returns a list of the configuration options which
may be registered by the library at runtime.

The idea here is that the sample config file generator can query this
and include the returned options in the sample config file of any
applications which use the library.

Some sample code for fetching available options:

  import pkg_resources

  for ep in pkg_resources.iter_entry_points('oslo.config.opts'):
      if ep.name == "oslo.messaging":
          list_opts = ep.load()
          for g, opts in list_opts():
              opts.sort(key=lambda x: x.name)
              print "[%s]" % g
              for o in opts:
                  print "%s = %s" % (o.name, o.default)
              print

Related-Bug: #1241566
Change-Id: Ic28351258652d2ea38974e2f4d1aa6b1d3dd7192
2014-01-27 11:24:52 +00:00
Mark McLoughlin
2ab150325b Fix test case name typo
This is just a copy-and-paste typo.

Change-Id: Ibe350ca650363749f88bbbc115898a8071129415
2014-01-27 10:39:20 +00:00
Ala Rezmerita
7295d8fdd2 Fix UnboundLocalError error
This change corrects the UnboundLocalError exception that
can occur if something bad happens on reconnect to RabbitMQ

Closes-Bug: #1272271

Change-Id: I9e157810caa7a45e9a61ec571cfe9024fabacf93
2014-01-24 12:06:03 +01:00
Jenkins
2862f502a6 Merge "Routing notifier" 2014-01-23 13:38:54 +00:00
Jenkins
258299d376 Merge "Add release notes for 1.3.0a3" 2014-01-22 11:23:44 +00:00
Andreas Jaeger
a5c7d6a2df Fix help strings
Use sentence style capitalization on help strings.

Change-Id: Ib3a8393eb0f3244d2ee431e71d3632195903b708
2014-01-18 16:16:19 +01:00
Mark McLoughlin
fff225538c Add release notes for 1.3.0a3
Change-Id: If97e1d695e498aac41aabbc1cea7cb9336b3b725
2014-01-17 12:38:51 +00:00
Dirk Mueller
60b6a9fe9d python3: Switch to mox3 instead of mox
In order to transition to a python 3.x compatible world,
lets switch to mox3 which is python 3.x compatible drop-in
replacement of mox.

Change-Id: Iaa22779cd516f842c9f70828f863f90ddae0bab5
2014-01-16 14:31:01 +01:00