ZeroMQ Context is a singleton and thus is created only once. This leads
to problems when there is more than one process working with it.
For example, while Neutron server starts, it firstly loads core
plugin and service plugins, which start message handling server,
and only then forks to create api-workers. As a result, all child
processes get the same copy of the context.
Creating new Context for each socket will prevent such situations
from happening and will guarantee that each process works with its
own Context.
Change-Id: I56912e39b119c20f6f23311fc2c7c4b9e9e480d0
Closes-Bug: #1364814
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
Basic unit tests for in-memory (localhost), ring and Redis based
matchmakers.
Redis tests are opportunitic based on a redis-server being installed
and running.
Test are currently skipped under py3 due to direct dependency on
eventlet.
Co-Authored-By: Kapil Thangavelu <kapil.thangavelu@canonical.com>
Change-Id: I59c4d095033370ab94f645af0d50e2502530f816
Partial-bug: #1302941
We can now set the pool name of a notification listener
to create multiple groups/pools of listeners consuming notifications
and that each group/pool only receives one copy of each notification.
The AMQP implementation of that is to set queue_name with the pool name.
Implements blueprint notification-listener-pools
Closes-bug: #1356226
Change-Id: I8dc0549f5550f684a261c78c58737b798fcdd656
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: I077b9b2060e618823ef6dd6f95ce9fe7dcc52a06
The TransportHost class allows user credentials to be supplied as part
of the URL that identifies the host. Prior to this patch, these
credentials - username and password - were ignored by the AMQP 1.0
driver. This prevents connections to a message broker that has been
configured to use SASL PLAIN authentication.
Closes-Bug: #1385445
Change-Id: Ib9279ed40b0f4cff62e1c742069c8f49f5625659
The documentation for the classmethod `parse` states that
The last parsed username and password will be propagated to the rest
of hosts specified::
user:pass@host1:port1,host2:port2
[
{"username": "user", "password": "pass", "host": "host1:port1"},
{"username": "user", "password": "pass", "host": "host2:port2"}
]
However, in practice one needs to specify the usernames and passwords
individually with every host.
DocImpact: Documentation needs to be changed due anomaly in TransportURL
parse classmethod.
Change-Id: I1a9e07e0380a0d6f7d00731df93c9ba01ae20e0e
Closes-Bug: #1355684
When a caller msg doesn't exists anymore but a reply is ready for it.
amqp driver drop the whole message into a logging.warn. That can be a
bit huge in some case.
This change just writes the message id to the WARN level and put the queues
and the messages into the debug level.
Change-Id: Ibcc6b066171cdea48f102ca1bd85f81c639fbbb5
Add pbr to the list of installation requirements so that it is installed
via pip before this library is installed, instead of with easy_install.
This avoids issues like Bug #1384919, and ensures that projects that use
this library as a dependency are properly installed.
Change-Id: I6c155370dbd01fe4748d5137bdf288e8d3e1a67e
Add driver independent functional tests of the messaging API
The url used to select (and configure) the driver is specified as an
environment variable named TRANSPORT_URL.
Change-Id: I867001a15ffaca06ae831cfd0240ed3397bf6503
In case of the call()er die, the queue used to reply must be
automatically deleted, otherwise they will never been deleted.
This is done in the same way as the rabbit drivers does,
by enabling auto-delete on this queue.
Change-Id: Ib01981d704b8849e0115791ff90fbb74cbac421f
Closes-Bug: #1374519
If you don't close the AMQP connection, then the connection
remains open and the next time when the messages are sent on
the listening topic, then some of the messages will not be processed
as there is no dispatcher running to process the message.
Closes-Bug: #1335086
Change-Id: I1f39eedf1500b6b6209ae0222f32e08e304895e0