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

Break the rabbit URL into its component variables #22

Merged
merged 3 commits into from
May 28, 2019

Conversation

nealedj
Copy link
Contributor

@nealedj nealedj commented May 13, 2019

Motivation and Context

Currently the only way to set the RabbitMQ connection variables is via the compond URL parameters. This isn't ideal for when we'll want to be able to pull in the username and password from Kubernetes secrets.

What has changed

Breaks out the Rabbit URL into its component parameters.

How to test?

make test

Copy link
Contributor

@jcox-dev jcox-dev left a comment

Choose a reason for hiding this comment

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

Unexpected param comment in one of the helper functions - otherwise looks useful!

NB. these changes will impact at least the following:

exchange_name=RABBIT_EXCHANGE,
queue_name=RABBIT_QUEUE,
queue_args=RABBIT_QUEUE_ARGS):
"""
Initialise connection to rabbitmq

:param rabbitmq_amqp: The amqp (url) of the rabbitmq connection
:param parameters: The CollectionParameters for the connection
Copy link
Contributor

Choose a reason for hiding this comment

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

parameters doesn't exist in init_rabbitmq parameter list?

parameters = pika.ConnectionParameters(RABBIT_HOST, RABBIT_PORT, RABBIT_VIRTUALHOST, credentials)

logger.debug('Connecting to rabbitmq', url=parameters.host)
return pika.BlockingConnection(parameters)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@nealedj
Copy link
Contributor Author

nealedj commented May 15, 2019

@codecov
Copy link

codecov bot commented May 28, 2019

Codecov Report

Merging #22 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   96.61%   96.72%   +0.11%     
==========================================
  Files           4        4              
  Lines         118      122       +4     
==========================================
+ Hits          114      118       +4     
  Misses          4        4
Impacted Files Coverage Δ
app/rabbit_helper.py 100% <100%> (ø) ⬆️
app/subscriber.py 100% <0%> (ø) ⬆️

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 f4ac6a3...9043590. Read the comment docs.

@jcox-dev jcox-dev merged commit 5a7ef7d into master May 28, 2019
@jcox-dev jcox-dev deleted the breakout-rabbit-variables branch May 28, 2019 09:02
@AdamHawtin AdamHawtin added this to the v1.0.0 milestone Aug 5, 2019
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.

4 participants