Commit Graph

33 Commits

Author SHA1 Message Date
Doug Hellmann e55a83e832 Move files out of the namespace package
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7
2015-01-12 12:50:41 -05:00
Mehdi Abaakouk c18f9f7c61 Don't log each received messages
oslo.utils.strutils.mask_password take too much time on
big payload (nova-conductor can receive payload ~ 66k in
largeops jobs for example).

This change removes this logging until we make mask_password
more efficient or we have a smarted the oslo.messaging logging to
not log everything.

Change-Id: Ib1f1d70c5cb820e8ff2de10e6064037808ea1f3a
Closes-bug: #1408362
2015-01-07 18:27:32 +01:00
Mehdi Abaakouk f3370da11a Don't share connection pool between driver object
Each driver instance must use it's own connection pool.

This removes the last global state of qpid and rabbitmq driver
Make the relation between classes more simple.

The previous behavior was not very safe, as explained in the bug report.

And also, this is a first step to replace this custom connection pool
handling by the kombu one.

Closes bug: #1397925
Partial bug: #1397339

Change-Id: Iecd2b39c76417d9ac081d46810f72eb6e38edfda
2014-12-02 08:26:17 +01:00
Mehdi Abaakouk 7306680bfa Remove unuseful param of the ConnectionContext
The ConnectionContext depends on the ConnectionPool.
A ConnectionPool already known the connection classes,
the configuration object and the url needed to create a new connection.

But we pass again thoses informations when we create a ConnectionContext.
This is unuseful, we can reuse thoses in the connection pool even we
want a not pooled connection.

This change removes the unuseful ConnectionContext parameters,
this also ensures that connection created with or without the pool
are created in the same ways and only at one place (the create method
of the connection pool).

Change-Id: I4bd43d202fa2774ad5dcb0f8dd05e58ba60c6009
2014-11-18 13:58:33 +01:00
Andreas Jaeger 7c2853a92c Improve help strings
Follow oslo.config conventions for consistency of help strings:
* Use sentence style capitalization.
* End entry with a "."
Fix capitalization of AMQP.

Change-Id: I0a6b170a2a7cfa539e06781f4495c4353d22e4d0
2014-08-28 06:59:33 +02:00
Christian Berendt 7fdeddaa3b Replace lambda method _
Instead of the lambda method _ the method should be imported
from oslo.messaging.openstack.common.gettextutils.

Change-Id: I373337cc1227b0d7b7bf93603b53a64de83721a9
2014-08-04 14:25:33 +02:00
Christian Berendt 5be1b6a6a9 Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: I08dafc4fa150d2213b2bb002da7c9ee0ee517fac
2014-07-17 12:41:21 +02:00
Aaron Rosen 0102aa96e6 Replace usage of str() with six.text_type
Replace using of str with six.text_type as it's able to
handle unicode data.

Change-Id: I38e4378c490d1dad8020312308dd3b6dad8772c0
2014-06-25 20:08:51 +00:00
Christian Berendt 409108c74f replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: I4a7ce6916aefb2f2d445f0ebd977c824b1c51e24
Partial-Bug: #1321274
2014-06-20 14:18:40 +01:00
Mehdi Abaakouk f4da213539 Remove amqp default exchange hack
This change remove the hack to set the default exchange of a transport in the
amqp driver, by removing the usage of the configuration object to get the
default exchange in rabbit and qpid driver, and instead use the value
passed to the driver constructor into all amqp publishers and consumers
class/method that needs it.

Closes-bug: #1256345
Change-Id: Iba54ca79a49f8545854205c1451b2403735c1006
2014-05-28 14:12:30 +02:00
Christian Berendt a6200c0a00 debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: I4af4a45a56b1364a2f5196b75cff299d607ab393
Partial-Bug: #1317950
2014-05-20 22:57:36 +02:00
Mehdi Abaakouk 53b9d741a8 Full support of multiple hosts in transport url
This patch add the support of multiple hosts in transport url for rabbit and
qpid drivers. And also fix the amqp connection pool management to allow
to have one pool by transport.

Implements blueprint multiple-hosts-support-in-url

Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>
Change-Id: I5aff24d292b67a7b65e33e7083e245efbbe82024
2014-04-22 17:02:52 +02:00
Mehdi Abaakouk fd86e0fd54 Remove old drivers dead code
This patch removes some common helper method/class.
Because they are not used anymore by current amqpdriver.

Change-Id: I183750e158e05cf1d0b5e37725676d4882e0c043
2014-04-03 14:35:34 +00:00
Mark McLoughlin 5464229e63 Do not leak _unique_id out of amqp drivers
In commit d8d2ad9 we delayed when a message's unique ID gets added to
the duplicate message cache in order to allow for message requeueing.

However, as part of this, we exposed the private _unique_id field
outside of the driver. This commit reverses that change by storing
the ID in the AMQPIncomingMessage object.

Change-Id: Ibeb7896de7ad9abf3c6a43495c1a87aabb762c0d
2014-03-03 07:18:54 -08: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
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
Victor Stinner 062c8ac7dd Replace dict.iteritems() with six.iteritems()
dict.iteritems() was replaced with dict.items() in Python 3. Use the
six.iteritems() function to get code compatible with Python 2 and Python 3.

Change-Id: I0c8ecc3ae540ffaf4c6b159e09ca16ccf365973d
2013-12-20 23:43:35 +01:00
Mehdi Abaakouk e57a15deb8 Remove eventlet related code in amqp driver
Because driver should rely on executor and not directly on eventlet,
delete eventlet related code. This also drop the old driver API.

This is the amqp part.

Change-Id: Ic6060058dafa4dabbc5e8c68bf231c818a7fec25
2013-12-16 17:30:36 +01:00
Mehdi Abaakouk 42ce3ab4b5 Remove the partial implementation of ack_on_error
The ack_on_error is not used by the abstraction layer, and only the
rabbitmq implements it.

This commit remove this feature, and next commit will add a new way for
this.

Partial implements blueprint notification-subscriber-server

Change-Id: I17eb23f2e3e374630251576438011f186e5b2150
2013-12-05 13:49:35 +01:00
Jenkins 3a2287c9e6 Merge "Ensure context type is handled when using to_dict" 2013-12-05 09:27:48 +00:00
Joe Gordon 5d046a5c97 Remove vim header
No need to set tabstop 189 times, this can be set in your vimrc file
instead.  Also if set incorrectly gate (pep8 check) will catch your
mistakes.

Change-Id: Ic6f0c0ef94e8194a5c121598305d1ec3c74e4843
2013-12-03 15:44:24 +00:00
Lance Bragstad d04fab6985 Ensure context type is handled when using to_dict
Handle the case where the context passed into def pack_context() is a
dictionary. If a dictionary is passed in, we don't need to call to_dict
before updating the msg.

Closes-Bug: #1208971
Change-Id: I2ce0b28f97634e717868e0ee5525189338d4981c
2013-12-03 15:44:07 +00:00
Chang Bo Guo 0b078b6062 Fix some typos and adjust capitalization
Change-Id: I61cf108f9746fc44a08d83e11d44ed1007a6a1fa
2013-11-03 07:07:51 -08:00
Mark McLoughlin 8b366b3001 Pop _unique_id when checking for duplicates
Drivers should not be returning messages with any driver-specific
wire format fields included. Right now, the rabbit and qpid drivers are
leaking the _unique_id field.

Avoid this simply by popping _unique_id when we're checking for dups.

Change-Id: Icbfb02ee66aebe5ef97a9a2502d8a0745e07bd8b
2013-08-02 06:48:01 +01:00
Mark McLoughlin 7bd60904f8 Move rpc_conn_pool_size into amqp
This is used in amqp.py, it shouldn't be registered in impl_rabbit.py.

Change-Id: I259f074019dd1bd7c210f84548bc5d4933b6aa89
2013-07-29 07:04:54 +01:00
Mark McLoughlin 45ab8699a6 Connection pool bugfix
This is only seen if you try to call amqp.cleanup().

Change-Id: I5c14a21987b4b7aeca7dddc91d7c8b2510edefeb
2013-07-26 07:41:09 +01:00
Mark McLoughlin 8ccb5741d2 Remove use of gettextutils
We don't have any infrastructure for localizations in oslo.messaging
so using this is pointless right now. I'm also generally not convinced
we want to translate any of the strings in this library anyway.

For now, just add a dummy _() function. We can can unmark the strings
later.

Change-Id: I1b6a698ee5558c50dc5eafee1f5f05ee2570435e
2013-07-24 08:15:35 +01:00
Mark McLoughlin c891e7ee24 Remove use of openstack.common.local
This means we no longer set the request context for the current thread
so that it can be used in logging.

We do need to add this back later, but it might be in the form of a
get_current_context() method.

Change-Id: I3f08a85e2019affddec829e2ea008b5c10707660
2013-07-24 08:15:35 +01:00
Mark McLoughlin 1a7e51eb4a Use stdlib logging
I guess this loses us automatic logging of details from request context.

Change-Id: I7413f025231c14b7cbdc9e90099407bc6c7943e1
2013-07-24 08:15:35 +01:00
Mark McLoughlin e3c5b99959 Port away from some eventlet infrastructure
Add a simple object pool implementation for our connection pool, in
place of eventlet.pools.Pool.

Also use threading.Lock in place of eventlet.Semaphore.

There are still some eventlet modules imported by the code, but we can
avoid using them at runtime and clean things up later. We can't remove
them now or it'll cause pep8 failures.

Change-Id: I380408d1321802de813de541cd0a2d4305c3627c
2013-07-24 08:15:34 +01:00
Mark McLoughlin 37bd6923dc Don't register options with cfg.CONF at module import
oslo.messaging will only register options with a ConfigOpts object
supplied by the caller.

Change-Id: I18115e9dd5241b1bdfae14671a62328c47125400
2013-07-24 08:15:34 +01:00
Mark McLoughlin 04dd4e1773 Adjust imports in rabbit/qpid drivers
Some modules are in oslo.messaging.openstack.common and others are in
oslo.messaging._drivers.

Change-Id: I3581eff3427858c8f46673e4a3c376367c626bb3
2013-07-24 08:15:34 +01:00
Mark McLoughlin e91dbef454 Add oslo-incubator code unmodified
I want to make it absolutely clear what changes we're making from the
original driver code, so let's start with a pristine copy.

Change-Id: I38507382b1ce68c7f8f697522f9a1bf00e76532d
2013-07-23 18:34:42 +01:00