Current implementation of RabbitMQ driver in in Connection.reset() change
the channel to use and create a new channel for it. This happens after the
each message send.
There no big need to create a new channel each time, so we can cancel all
consumer queues, instead of creating a channel in reset().
Test test_connection_reset_always_succeed() removed, because we are not
create channel on reset() anymore.
Co-Authored-By: Mehdi Abaakouk <sileht@redhat.com>
Change-Id: Ie164840e6c055b01525b13aabdb8b9c7f5d1b98b
During the vancouver summit, Michael Klishin from
pivotal proposed we should use publisher confirms
as the default setting to reduce messages being
dropped on the floor.
https://www.rabbitmq.com/confirms.htmlhttp://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms/
This setting is a lightweight way of keeping track of which messages
have been processed by the broker and which would need re-publishing
in case of broker shutdown or network failure.
Change-Id: I25bc955df130dad4725f5281211d37fd73e7ea63
When rpc_conn_pool_size have been moved from amqp.py to base.py:
87137e7af05f12a99bd04566036fbf71824f45cf
We loose the deprecated_group, this change reintroduces it.
Change-Id: I8cdea7f042afebcc162bafef881ebe61a1cac989
At the moment for each msg_id we receive two amqp message - first one
with the payload, a second one to ensure the other have finish to send
the payload. This was made, because a long time ago 'reply' allowed
generator as payload to send multiple messages on one 'rpc.call' - [1]
It's a bad idea - to double RPC messages for each call, so we are going
to remove this the second AMQP message sending. This patch allows
receiver side to proceed correctly old case - two AMQP messages (first
with data and second with 'ending' parameter) same as the new one (a
single message with data 'ending' parameter)
Blueprint: remove-double-reply
[1] - https://github.com/openstack/oslo-incubator/blob/stable/icehouse/openstack/common/rpc/amqp.py#L464
Change-Id: Ic09fe619694c300c4502acb7157d7ecdd47c5fd7
heartbeat_thread is not set for listeners. when closing connection,
it blindly checks heartbeat_thread and will throw an error causing
connection to remain open. this patch explicitly sets
heartbeat_thread to None.
Change-Id: Ief3bf02f952882ecadf742cdd0bac8edd7812473
Closes-Bug: #1458917
When we send a reply and the exchange is missing, they
no need to wait more that the timeout set by the application.
Change-Id: I7eb19346d72cb0a4813c964df1435d7f4c79e218
impl_rabbit set timeout into message's header with {'ttl': (timeout * 1000)},
this mean doesn't work in real, messages still stays in queue after the ttl.
As RabbitMQ document said (http://www.rabbitmq.com/ttl.html#per-message-ttl),
we should passing "expiration" into message's property rather than header to
make it work.
Change-Id: I5d6ae72e69f856c56fb83fb939ed35246716e04d
Closes-bug: #1444854
Each times we send a message with the rabbit driver we create useless
object that's not more that the kombu exchange and a wrapper method around
the kombu producer.
So, this change just creates the exchange not our useless custom Publisher
and move the wrapped methods into the Connection object.
Change-Id: Id221f4363d897cd904f7aeccbc90cbd288db2db1
They are some case where the underlying can be stuck
until the system socket timeout is reached, but in oslo.messaging
we very often known that is not needed to wait for ever because
the upper layer (usualy the application) expect to return after
a certain period.
So this change set the timeout on the underlying socket each we can
determine that is not needed to wait more.
Closes-bug: #1436788
Change-Id: Ie71ab8147c56eaf672585da107bec8b22af9da6c
Add a check, that MessagingTimeout raises on long-running queries,
if client sends another queries at the same time.
Added a long_running_task() to TestServerEndpoint and allowed to pass a
message executor into the RpcServerFixture.
Related bug: #1338732
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Change-Id: Icafb6838e2d9fb76b6d1c202465c09c174a3bed9
The list_opts entrypoint test failed unnecessarily when the
dependencies in the packages were inconsistent. This test doesn't
need to verify that the dependencies are consistent, only that the
entrypoint is available and provides the expected function.
Change-Id: I0bb0f2b591c402202104af8daf07d56b514cbb2f
All plugins are supposed to be importable without their dependencies so
we can discover options and documentation. Restructure the parts of the
AMQP1 driver that depend on having proton and pyngus installed so the
driver can load without them.
Change-Id: Id0c8c2a6ae44d13f061e651c33efc9e38750a049
Oslo.messaging have an outdated release in the code tree.
but now the release note is published on the mailing.
This change removes it.
Change-Id: I0a3401b7c9bc8230169e75727e45a99e6c3c780f
The NotifyPublisher was redeclaring again and again,
the same exchange and queue each times a notification is sent.
This change fixes that by caching the already declared exchange
and queue for each channel.
Also, to make the test pass. 'Connection.ensure' have been updated
to have the same behavior for amqp and memory driver about
kombu recoverable_errors. And the hostname and port of the memory
driver are set to not fail when we print a log message.
Closes bug: #1437902
Change-Id: I20d133ac67b8a8a4c51d51b6a1b2369aa44ffe2f
In case the acknowledgement or requeue of a message fail,
the kombu transport can be disconnected
In this case, we must redeclare our consumers.
This changes fixes that.
This have no tests because the kombu memory transport we use in our tests
cannot be in disconnected state.
Closes-bug: #1448650
Change-Id: I5991a4cf827411bc27c857561d97461212a17f40
We at least need these versions of amqp and kombu to have
a working heartbeat support.
Related-bug: #1436788
Closes-bug: #1436769
Closes-bug: #1408830
Change-Id: I61440c5ccf2b540fe9a1e868bdcae9f5d2cf8422
This removes a TODO, that was not possible before the consumer code
refactoring.
Now, we can just catch the right exception instead of catching
everything and pray.
Change-Id: Id6203d79d4b2f027e5c6cd952c99fcd0967ecb3c
When a consumer is declared after we have started to consume
amqp, its queue is never consumed.
This fixes that.
Closes bug: #1450342
Change-Id: I9f2e7d83283504dfe762ac88384efde0f7b52d47
The consumer code is over engineered, it allows to override
everything, but the override is always done with functools.partial.
None of the child Class have the same signature, sometimes
the constructor use the parameter name as the parent class but for
a different purpose, that makes the code hard to read.
It's was never clear which options is passed to the queue and the
exchange at this end to kombu.
This changes removes all of that stuffs, and only use the kombu
terminology for consumer parameters.
Alse we don't hardcode anymore the tag and the channel in the consumer
class, to allow to change them without recreating a consumer object
in the futur.
Change-Id: Ie341f0c973adbda9a342cb836867345aa42652d1
The publisher code is over engineered, it allows to override
everything, but this is never used.
None of the child Class have the same signature, sometimes
the constructor use the parameter name as the parent class but for
a different purpose, that make the code hard to read.
It's was never clear which options is passed to the queue and the
exchange at this end to kombu.
This changes removes all of that stuffs, and only use the kombu
terminology for publisher parameters.
Change-Id: I3cebf3ed1647a3121dcf33e2160cf315486f5204
This serializer available (with some differences) in ceilometer,
cinder, designate, heat, ironic, magnum, manila, neutron, nova, trove.
So we can move it to the common code and re-use (or inherit from it) in
OpenStack projects
Change-Id: I0d68b1d98c2214a5d45b65146ac2d19e5f6f5953
When uses the default port, kombu.Connection.port is None
So we replace the usage of kombu.Connection.port per
kombu.Connection.info(), to get the default value.
Also some transport driver have 'None' for hostname or port as default
value, so replace usage of '%d' per '%s', to ensure the logging never fail.
Event the output of the log is less sexy.
Change-Id: I89ca1982246146717015253bd4cc26f992381584
Closes-bug: #1452189
The consumer loop is over engineered, it returns unused return,
iterconsume creates an iterator directly consumed by 'consume' without
special handling, and in some case kombu error callback are called when
the iterator is stopped and log useless error.
And in reality the consumer is always called when limit=1.
This change simplifies that, by removing the loop and removes all
returns stuffs.
Closes bug: #1450336
Change-Id: Ia2cb52c8577b29e74d4d2b0ed0b535102f2d55c7