Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to amqp version 2.4.2 #119

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bakkerd
Copy link

@bakkerd bakkerd commented Sep 11, 2019

As amqplib is quite old (https://pypi.org/project/amqplib/#history) and I had some issues with reconnecting, I propose to update it to amqp, which has the same interface, but is maintained and widely used.

@nklapste nklapste requested review from nklapste and removed request for nklapste September 11, 2019 23:38
@nklapste
Copy link
Collaborator

Would it be possible to add some instrumentation testing for the GELFRabbitHandler to validate the implementation and usage of this library?

@bakkerd
Copy link
Author

bakkerd commented Sep 21, 2019

It would be an integration test, using an instance of rabbitmq. They are not in place, so it is not trivial to implement, which is why I did not include tests yet.
I see that you did add some for direct graylog integration testing, so I will try re-using those.

@nklapste
Copy link
Collaborator

Doing a integration test would be preferred. As it also give a implicit example on how to setup graypy -> rabbitmq -> graylog.

Good luck with working off of that past branch. I sadly was struggling with setting up a rabbitmq -> graylog environment with docker that was performant and effective for testing.

@@ -93,6 +93,7 @@ def __init__(self, cn_args, timeout, exchange, exchange_type, routing_key):
self.routing_key = routing_key
self.connection = amqp.Connection(
connection_timeout=timeout, **self.cn_args)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that the amqp.Connection class expects connect_timeout instead of connection_timeout keyword parameter. This is actually a bug also with current amqplib.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, good find.

@codecov-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

Merging #119 into master will increase coverage by 1.47%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   95.97%   97.44%   +1.47%     
==========================================
  Files           3        3              
  Lines         273      274       +1     
==========================================
+ Hits          262      267       +5     
+ Misses         11        7       -4
Impacted Files Coverage Δ
graypy/rabbitmq.py 93.22% <100%> (+7.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3d1d85...4d92ac6. Read the comment docs.

@cyber-conor
Copy link

@martinvy any updates on this PR? This seems to fix an issue I've been having with graypy/amqp.

The amqplib module is so old that is requires you to stick to a version of setuptools no newer than 59.8.0 in order to install graypy with the amqp extra. Otherwise after doing an install of graypy will get you this issue:

>>> import graypy 
>>> graypy.GELFRabbitHandler()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'graypy' has no attribute 'GELFRabbitHandler'

It would be fantastic if we could get a new graypy release in pypi with this fix.

@bakkerd
Copy link
Author

bakkerd commented Jun 21, 2022

@cyber-conor Good question, I think this pull request is good to go. At the time nobody seemed to work on this project anymore, but I see some recent updates in the last months. @nklapste, could you have a look at this, and if you have the “authority” merge this if you are content?

EDIT: @nklapste I even added the integration test you requested😉

@billsioros
Copy link

billsioros commented Aug 28, 2023

Would love to see this merged! 💯 I've been using @bakkerd 's fork and I have not come across any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants