summaryrefslogtreecommitdiff
path: root/amqp/connection.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix typosKian-Meng, Ang2021-11-061-1/+1
|
* Initial reference documentation amqp.transportMatus Valo2020-11-101-3/+4
|
* Added __repr__ to Connection() and *Transport() classesMatus Valo2020-09-141-0/+8
|
* pyupgrade.Omer Katz2020-09-031-7/+7
|
* Stop to use deprecated method ssl.wrap_socket (#327)Hervé Beraud2020-09-021-2/+2
| | | | | | | | | | | | | | | | | | `ssl.wrap_socket` is deprecated since python 3.7 and since python 3.2 and 2.7.9 (released in 2014) it is recommended to use the SSLContext.wrap_socket() instead of wrap_socket(). The top-level function is limited and creates an insecure client socket without server name indication or hostname matching [1]. Python 2.7 is now officially unmaintained, latest version of python 2.7 is 2.7.18, py-amqp only support python versions who are compatible with these changes [2]. These changes move away from `ssl.wrap_socket` by using now `ssl.SSLContext.wrap_socket` [3]. [1] https://docs.python.org/3/library/ssl.html#ssl.wrap_socket [2] https://github.com/celery/py-amqp/blob/master/setup.py#L24,L29 [3] https://docs.python.org/3/library/ssl.html#ssl.SSLContext.wrap_socket
* Happify linters.Omer Katz2020-08-311-3/+4
|
* Make __all__ immutable.Omer Katz2020-08-191-1/+1
|
* Drop Python 2.7 and 3.4 support.Omer Katz2020-08-191-8/+14
|
* Fix flake8Matus Valo2020-04-211-1/+1
|
* Separate logger for Connection.heartbeat_tick methodOwain Jones2020-04-161-3/+6
| | | | | | I have a microservice=y project where I'm using py-amqp extensively. In the development environment I would guesstimate that 90% of the debug logs from these services are from `amqp.connection.Connection.heartbeat_tick`. I still want to see all the other debug output, but selectively filter out the heartbeat debug from my own code via `logging.getLogger('amqp.connection.Connection.heartbeat_tick').setLevel(logging.INFO)`.
* Reverse the conditions for clarity.Omer Katz2019-09-111-13/+15
|
* Fix a channel issue against a connection already closedHervé Beraud2019-09-111-3/+5
| | | | | | | | | | | | In some possible case a connection can be closed (network issue, etc...) and then channels reset to None, in this case if the client use the on_inbound_method then we can facing a TypeError exception. The `on_inbound_method` is not enough safer and then this method can try to get channel from a none existing object. In this case we need to raise a `RecoverableConnectionError` to allow client to re-connect properly and re-init objects properly.
* Ignore all methods except Close and Close-OK when channel/connection is ↵Matus Valo2019-06-131-1/+6
| | | | closing (#280)
* Don't revive channel when connection is closing (#220)Matus Valo2018-12-301-0/+2
| | | | | | | | | | | | * Don't revive channel when connection is closing * When connection is closing dont raise error when Channel.Close method is received * Added unitests * Fix flake8 * Fix typo
* Handle negative acknowledgments sent by RMQ (#208)Matus Valo2018-10-191-0/+4
| | | | | | | | | | | | | | | | | | * Handle negative acknowledgments sent by RMQ * Make flake8 happy * Update documentation * Fix redundant parameter in _on_basic_nack + added unittests * Increase coverage of unittests * Move MessageNacked to exceptions.py * Make flake8 happy * Make flake8 happy
* Issue#209: Connection.connect, Connection.close don't close socket on ↵tomc7972018-10-121-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exception (#210) * If there is an exception raised on Connection.connect or Connection.close, ensure that the underlying transport socket is closed * Added more informative message for exception * Fix code style to satisfy travis checks * Fix code style to satisfy travis checks * Provided more informative exception message when remote unexpectedly hangs up * Test the setting of SO_RCVTIMEO, SO_SNDTIMEO * callback is soley invoked when connected From the unit tests, I gleened that the callback should only be invoked when Connection.connected is true * Code style fixes * Code style fixes * Code style fixes * Code fix, wrap line continuation differently * Added three tests to improve coverage Test to ensure connect is idempotent. Tests to confirm EOF behavior.
* Support for EXTERNAL authentication and specific login_method (#176)Matthias Erll2018-01-021-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | * Added EXTERNAL SASL implementation. * Added EXTERNAL to authentication methods. * Adjusted tests. * Consider login_method parameter, accept empty userid and password where inapplicable. * Added test for login_method. * Style fixes. * Added SASL tests. * More detailed connection tests. * Inserted line breaks. * Added one more login_method test. * Added missing word in comment.
* isort.Omer Katz2017-10-281-9/+6
|
* Remove LGPL headers from source files as project has since changed to BSD (#163)Adam Smith2017-08-241-14/+0
|
* Convert mechanisms to bytes if it is a string (#157)Omer Katz2017-07-141-1/+3
| | | | | | | | * Convert mechanisms to bytes if it is a string * Make linter happy. * Fix apicheck while we're here.
* Drain events should read until message is ready (#144)Robert Kopaczewski2017-05-221-1/+3
| | | | | | | | * Drain events should read until message is ready * return true if we're done with frame=1 * freeze pydocstyle at 1.1.1
* don't fail if collect already called (#128)gord chung2017-04-131-1/+2
| | | | avoid AttributeError if collect is called and no channels exist. can occur if collect called twice.
* Refactored to make authn modular; added GSSAPI (#110)Alexander Dutton2016-12-291-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactored to make authn modular; added GSSAPI * Getting tests passing again * Add missing __future__ import to new source file * Made it more obvious that login_method/login_response not heeded However, we could create a SASL subclass that provides the functionality for backwards compatibility. * Also try PLAIN if we're given a userid/password. * Squashing flakes * Reimplemented login_method/login_response; flake fixing * An extra test; deflaking * Remove a blank line to sate flake8. Great. * SASL tests! Also wrapped getting GSSAPI mech impl in a function, so we can test it with and without a `gssapi` module present. * Fixing tests I'd misnamed my test class while debugging something, and not reverted it. Now the new tests are being run, another mistake appeared, now fixed. * More tests for the coverage gods * Attempt GSSAPI (but don't fail hard), and use userid This adds fail_soft and client_name arguments to GSSAPI, so that: * amqp.connection can add GSSAPI to its default list of auth mechanisms, but not fail if the gssapi module isn't available, or if GSSAPI credentials aren't available * A user can use userid to specify which GSSAPI client credentials should be used. Authentication mechanisms can also now return NotImplemented if they decline to do SASL negotiation at start() time. * Added another test for GSSAPI client name explicitly specified * Make pydocstyle happy. * Improving test coverage
* do not reconnect on collect (#121)gord chung2016-12-291-1/+2
| | | | | | | | | | | | | | | | * do not reconnect on collect collect is called to cleanup when there is a connection error but the backward compatibility code to connect when transport is called gets triggered. this doesn't seem right as this should be handled by ensure_connection. * do not reconnect on collect collect is called to cleanup when there is a connection error but the backward compatibility code to connect when transport is called gets triggered. this doesn't seem right as this should be handled by ensure_connection.
* Adds pydocstyle tox targetAsk Solem2016-10-111-35/+43
|
* Removes left over print statements. Closes #3465Ask Solem2016-09-231-2/+0
|
* Support for the RabbitMQ auth_close extension (closes celery/kombu#611)Ask Solem2016-09-131-14/+42
|
* Frame_writer is no longer a generator. Closes #103Ask Solem2016-09-071-4/+1
|
* CosmeticsAsk Solem2016-08-091-17/+19
|
* Fixes argspec for Connection.Close: BssBB -> BsBB. Closes #45Ask Solem2016-07-111-1/+1
|
* set literalAsk Solem2016-06-151-2/+2
|
* flakesAsk Solem2016-05-311-1/+2
|
* Backward compatibility with 1.4 API (Closes celery/kombu#595)Ask Solem2016-05-311-12/+59
|
* Removes outdated funtests directoryAsk Solem2016-04-061-3/+2
|
* flakesAsk Solem2016-03-211-1/+1
|
* Transport: re-raise original socket.error to keep errno etc.Ask Solem2016-03-021-25/+4
|
* Connection.channel now raises RecoverableConnectionError if closed (Closes #70)Ask Solem2016-03-021-6/+8
|
* Removes unused Connection.FIXMEAsk Solem2016-03-021-3/+0
|
* Now uses vine for promisesAsk Solem2016-03-021-6/+8
|
* Fixes args/kwargs confusion when creating transport. Closes #72Ask Solem2016-01-081-6/+6
|
* Unit tests for amqp, with 96% coverage so farAsk Solem2015-12-071-25/+34
|
* Connection.__init__ no longer connects automatically, use connection.connect()Ask Solem2015-12-071-11/+17
|
* Python 2.7ismAsk Solem2015-10-191-1/+1
|
* FlakesAsk Solem2015-09-181-2/+2
|
* Merge branch 'reclaro/set_keepalive_settings'Ask Solem2015-09-091-11/+7
|\
| * Set tcp socket optionsAndrea Rosa2014-07-161-3/+1
| | | | | | | | | | | | | | This change allows to set the TCP options for the sockets used by transport class. The socket options are passed as a dictionary where the key is the name of the option and the value is set as option value. At the moment we support just options for the TCP level.
| * Expose socket optionsAndrea Rosa2014-06-261-3/+3
| | | | | | | | | | | | | | | | | | This change allows to set socket options. It's up to the user to pass the options as tuple of tuples, where each tuple is in the form of (family, option, value). Please note that if the values passed in the tuple are not correct no excetion are managed by the new code but every error is propagated to the caller.
| * Expose keeaplive settingsAndrea Rosa2014-06-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This change allows to set some TCP socket options during the creation of the transport. The parameters exposed are: - TCP_KEEPIDLE - TCP_KEEPINTVL - TCP_KEEPCNT Those values can be set passing a dictionray where the key is the name of the parameter we want to set. The names of the keys are the ones reported above.
* | add keepalive optionsRongze Zhu2015-09-091-4/+14
| | | | | | | | | | | | | | | | | | if the rabbitmq-server's host crush, the consumer will not receive 'socket close' until 7200 seconds elapsed (os default value), so the consumer cann't receive any message while in 7200 seconds. the patch add keealive options, so we can set short keepalive_idle to avoid it.
* | flakesAsk Solem2015-09-041-4/+10
| |