-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use password authentication with RabbitMQ #223
Conversation
Pull Request Test Coverage Report for Build 8468322182Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sajith excellent to see you already have submitted a code to handle RabbitMQ auth, which is an important step on the environment setup (since Luis setup is also using authentication). The code seems clear and neat. Very nice!
I just have one doubt. I do see pika.ConnectionParameters
being used on other places that you didn't cover on this PR, as well as RabbitMqServerConfigure
which references MQ_HOST variable.
can you please take a look on the following occurrences:
./sdx_controller/messaging/topic_queue_consumer.py:MQ_HOST = os.environ.get("MQ_HOST")
./sdx_controller/messaging/topic_queue_consumer.py: pika.ConnectionParameters(host=MQ_HOST)
./sdx_controller/messaging/topic_queue_consumer.py: # pika.ConnectionParameters(host=MQ_HOST)
./sdx_controller/messaging/message_queue_consumer.py:MQ_HOST = os.environ.get("MQ_HOST")
./sdx_controller/messaging/message_queue_consumer.py: def __init__(self, host=MQ_HOST, queue="hello"):
./sdx_controller/messaging/message_queue_consumer.py: serverconfigure = RabbitMqServerConfigure(host=MQ_HOST, queue="hello")
./sdx_controller/messaging/rpc_queue_producer.py:MQ_HOST = os.environ.get("MQ_HOST")
./sdx_controller/messaging/rpc_queue_producer.py: pika.ConnectionParameters(host=MQ_HOST)
./sdx_controller/messaging/topic_queue_producer.py:MQ_HOST = os.environ.get("MQ_HOST")
./sdx_controller/messaging/topic_queue_producer.py: pika.ConnectionParameters(host=MQ_HOST)
./sdx_controller/messaging/topic_queue_producer.py: # self.connection = pika.BlockingConnection(pika.ConnectionParameters(host=MQ_HOST))
@sajith if you allow my contribution here, below is a augmented version of the changes you made to also include the files above (I tried to follow the same approach/code-style as you):
|
Thank you for the update, @sajith! I will now test using the main branch with this change. |
@italovalcy Good catch Italo! Thank you. And sorry about the latency -- I've been away. As you've noticed, in this PR, I only addressed the subscribe part, and I missed the publish part. There are two places where SDX Controller uses the message queue. This is where it listens for incoming messages: sdx-controller/sdx_controller/__init__.py Lines 25 to 32 in b8e5f22
And this is where it publishes: sdx-controller/sdx_controller/handlers/connection_handler.py Lines 78 to 81 in b8e5f22
That is it, as far as I know. There are several classes under sdx_controller/messaging, but I am not very familiar with them. It probably would be useful to simplify the code under that directory and remove the unused code (or make it a library that both sdx-controller and sdx-lc can use), but I am not sure if/when to do that or if it is worth the effort. I believe @congwang09 might have opinions on it. Your contributions are totally welcome, and your approach is certainly better. Would you be willing to start a PR? |
Good afternoon, I suggested isolating the RabbitMQ process from other submodules as a microservice. like here: atlanticwave-sdx/sdx-continuous-development@e7cfa41 |
Hi @sajith great points you raised. Thanks for continue the discussion and I agree with you regarding simplifying the code under Thanks again for you comments, @sajith! |
Opened Issue #249 to discuss code cleaning opportunities under @sajith with that said, I will update my review and approve your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Additional changes to allow RabbitMQ authentication
Resolves #197.