Commit Graph

35 Commits

Author SHA1 Message Date
Matus Valo 34500e1e2c Added integration test of failed authentication to redis 2021-11-06 13:26:44 +06:00
Matus Valo 73b10a9346 Return empty list instead of InconsistencyError when exchange table is empty
Missing redis key containg set of queues bound to queue is caused
by removal all queues from the exchange. Hence, we should not raise an
exception but just return empty list of queues instead. This commit
fixes e.g. case publishing message against empty exchange:

import kombu
conn = kombu.Connection('redis://')
exchange = kombu.Exchange('name', type='direct')
exchange.declare(channel=conn.default_channel)

producer = conn.Producer()
producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)

But it also fixes the case when last queue is unbound from exchange and
after publishing to this exchange:

import kombu
conn = kombu.Connection('redis://')
exchange = kombu.Exchange('name', type='direct')
queue1 = kombu.Queue('queue1', exchange=exchange, routing_key='queue1')
exchange.declare(channel=conn.default_channel)
queue1 = queue1.bind(channel=conn.default_channel)
queue1.declare()

producer = conn.Producer()
producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)

queue1.delete()

producer.publish(
     {'hello': 'world'},
     exchange=exchange,
     routing_key='queue1'
)
2021-10-25 07:28:10 +06:00
Matus Valo 8a770d2f18 Run integration tests for kombu also with global_keyprefix 2021-08-31 15:57:54 +06:00
Thomas Grainger 241b5dcff8
enable pre-commit (#1355)
* enable pre-commit

* use extend-ignore for flake8

* manual flake8 fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update kombu/__init__.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-07-20 19:07:49 +06:00
Omer Katz 7a6e7cc45b pyupgrade 2020-07-13 16:58:06 +03:00
Matus Valo 75027490c7
Revert incompatible changes in #1193 and additional improvements (#1211)
* Revert incompatible changes introduced in #1193

* Improved integration tests covering connection

* Fix unittests on python2 + flake8 fixes
2020-06-10 15:14:47 +06:00
Matus Valo 16749626a4
default_channel should reconnect automatically (#1209) 2020-06-05 09:20:56 +02:00
Matus Valo 25a0266651 Ensure connection when connecting to broker 2020-06-01 12:56:32 +06:00
Matus Valo c9451787be Fix flake8 2020-05-15 23:30:55 +02:00
Matus Valo 963819dd73 Improve integration test suit 2020-05-15 17:08:29 +02:00
Matus Valo e316313222 Improved Priority integration tests 2020-05-13 08:59:57 +02:00
Matus Valo e0c27f3cfe Added priority integration tests for Redis 2020-05-12 09:56:04 +02:00
Matus Valo 0d3b1e254f Added integration tests for priority queues 2020-05-08 11:32:46 +02:00
Matus Valo 5113df342e Added TTL integration tests 2020-05-06 14:36:21 +02:00
Matus Valo 5d55eba3ec Added Integration tests for direct, topic and fanout exchange types 2020-05-06 08:42:41 +02:00
Matus Valo 49606a1a14 Use explicit py-amqp transport instead of amqp in integration tests 2020-05-04 16:56:44 +02:00
Matus Valo 0b3ccd06b2 Added Simple Buffer integration tests 2020-05-04 13:16:49 +02:00
Matus Valo 6a5c3ccfc8 Rename test classes for better test output 2020-05-03 22:47:24 +02:00
Matus Valo 03ff0bf153 Removed scripts depending on RabbitMQ 2020-05-03 09:39:28 +06:00
Matus Valo 7c87441feb Create common class of integration tests 2020-05-03 09:39:28 +06:00
Matus Valo 75667082e0 Initial redis integration tests implementation 2020-05-03 09:39:28 +06:00
Matus Valo 02bfccf9f7 Added basic integration tests for RabbitMQ 2020-04-30 10:43:50 +06:00
Matus Valo 3155e9407f Added integration testing infrastructure for RabbitMQ 2020-04-30 10:43:50 +06:00
Clemens Wolff 32633554ac Add transports based on Azure PaaS (#891)
* Add transports based on Azure PaaS

This pull request adds two new transport implementations:

- `azurestoragequeues` is implemented on top of Azure Storage
  Queues [1]. This offers a simple but scalable and low-cost PaaS
  transport for Celery users in Azure. The transport is intended to be
  used in conjunction with the Azure Block Blob Storage backend [2].

- `azureservicebus` is implemented on top of Azure Service Bus [3] and
  offers PaaS support for more demanding Celery workloads in Azure. The
  transport is intended to be used in conjunction with the Azure
  CosmosDB backend [4].

This pull request was created together with @ankurokok, @dkisselev,
@evandropaula, @martinpeck and @michaelperel.

[1] https://azure.microsoft.com/en-us/services/storage/queues/
[2] https://github.com/celery/celery/pull/4685
[3] https://azure.microsoft.com/en-us/services/service-bus/
[4] https://github.com/celery/celery/pull/4720

* Exclude Azure transports from code coverage

There is test coverage for the transports but the tests require Azure
credentials to run (passed via environment variables) so codecov doesn't
exercise them.

* Remove env vars to configure transport

* Remove abbreviations
2018-08-30 23:34:52 +06:00
Asif Saifuddin Auvi 491d7f389b
used unittest and remove unittest2 (#855) 2018-04-29 23:46:59 +06:00
Mads Jensen c13d91634d Removed an always true if-check in t/integration/transport.py (#827) 2018-01-27 11:22:49 +02:00
Amin Ghadersohi be79b3d4cd Re-Adding support for sqlalchemy as it is needed by Apache project Airflow (#687)
* Re-Adding support for sqlalchemy as it is needed by Apache project Airflow

* Re-Adding support for sqlalchemy as it is needed by Apache project Airflow
2017-05-17 14:17:47 +06:00
Anthony Lukach 6c3bb07e19 Bugfix: Support Python 3.4, decode from base64 when converting messag… (#714)
* Bugfix: Support Python 3.4, decode from base64 when converting message to Python

* Use str_to_bytes
2017-04-14 23:43:06 +06:00
Mischa Spiegelmock 129a9e4ed0 Switching to boto3 only (#693)
* Switch Boto2 to Boto3 for SQS messaging

* Fixed region support

* Add SQS FIFO queue support

* Add sensible defaults for message attributes

* Asynchronous support, plus boto3 for region endpoint lookups

* Clean up imports

* Fix Python 2 support

* Fix receive_message tests

* Reformat docstring

* boto3 import changes for CI

* skip tests if boto3 not installed

* skip tests if boto3 not installed

* flake8

* noboto

* ditching boto2. got queue URL fetching, async HTTP request generation and signing working.

* request signing working kinda

* async parsing of SQS message response more or less working

* botocore sqs dep

* ripping out more old boto2 stuff

* removing tests that are no longer valid with boto3/SQS

* fix boto3 dep, min version and no botocore

* no boto2 for test

* cleaning up some SQS tests. fixing header parsing of response to msg

* fixing some sqs tests

* removing response-parsing tests that are no longer necessary as we're using the botocore response parsing machinery instead of implementing SAX parsing in kombu.

* fixing more SQS tests

* wants a region

* trying to fix py2 parsing of sqs message

* lint

* py2/py2 message header parsing stupidness

* forgot

* python 2 sux

* flake8

* Import boto3 from the right place

* Changes

* Update encode fuction

* Fix lint

* remove some unused things

* removing unused stuff

* ugh

* ugh

* ugh

* landscape ignoring

* shut up, landscape
2017-04-14 11:22:18 +06:00
Ask Solem ded6f0c873 Entities can now be declared without binding to channel: entity.declare(channel=channel) 2016-10-27 14:22:19 -07:00
Ask Solem ed783a02ef Small changes to #598 2016-09-07 17:33:49 -07:00
Alan Justino 74f0180576 Some python versions have no 'buffer' builtin 2016-09-07 17:30:18 -07:00
Alan Justino fd1cea31ca hashlig _digest() works only with bytes 2016-09-07 17:30:13 -07:00
Alan Justino c17861e574 Some Python versions have no string.letters 2016-09-07 17:30:06 -07:00
Ask Solem cff1b829cd Moves funtests -> t/integration 2016-08-23 12:52:14 -07:00