Skip to content

Configuration of connection settings as URL #271

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

Merged
merged 1 commit into from
Oct 17, 2016
Merged

Configuration of connection settings as URL #271

merged 1 commit into from
Oct 17, 2016

Conversation

kingcrunch
Copy link
Contributor

It would be nice, if I could configure the connection settings as a single string for example as an URL instead of 4 separate keys.

//user:password@host:post/vhost

@videlalvaro
Copy link
Collaborator

This is a duplicate of https://github.com/videlalvaro/RabbitMqBundle/issues/113

If you have time and will of submitting a PR, I would welcome it.

@kingcrunch
Copy link
Contributor Author

Hi @videlalvaro

I've converted this one into a PR (I don't think I can do this with #113, can I?). Feedback appreciated. Especially one cannot set the ssl_context-parameters via URL. This solution is inspired by the way the doctrine-bundle handles the URL, so like there one can omit every part (here: except the scheme and the host) and in that case the normal configuration options will be used again.

another:
# A different (unused) connection defined by an URL. One can omit all parts,
# except the scheme (amqp:). If both segment in the URL and a key value (see above)
# are given the value from the URL takes precedence.
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does the URL overrides what ones set above in a connection specifically? I would do it the other way around, the URL fills in values that might have not been specified in the connections confs

@videlalvaro
Copy link
Collaborator

Are you following this spec: https://www.rabbitmq.com/uri-spec.html ?

@kingcrunch
Copy link
Contributor Author

Yes, at least I tried. Tell me, when I missed something. On the other hand the spec cover pretty common URIs, so there should be no bigger surprise.

@videlalvaro
Copy link
Collaborator

Any replies to my comment:

why does the URL overrides what ones set above in a connection specifically? I would do it the other way around, the URL fills in values that might have not been specified in the connections confs

@videlalvaro
Copy link
Collaborator

@kingcrunch did you see my comments above? I would really like to merge your PR

@kingcrunch
Copy link
Contributor Author

@videlalvaro Sorry, I indeed missed that comment.

The reason the URL overwrites the other settings is, that this is the way the DoctrineBundle works. I don't know, what's the idea, but I wanted to keep it in sync. Both are bundles and having two connections URLs, but both behaves differently would be confusing. However, that's nothing I'd fight for.

@videlalvaro
Copy link
Collaborator

@kingcrunch OK, if that's the way DoctrineBundle works, then we follow what the community is already doing.

I'll review this again then.

@kesar
Copy link

kesar commented Oct 3, 2016

👍 it would be great to have this merged

@dragosprotung
Copy link
Contributor

Is there a reason this is not merged ?

Something like amqp://foo:bar@localhost/baz
The intention is to allow to specify exactly one configuration option per connection, which
is easier to outsource into parameter files.
@kingcrunch
Copy link
Contributor Author

At least there were some conflicts now. I've rebased the branch, so somebody can review again and merge afterwards.

@skafandri skafandri merged commit 82ee45b into php-amqplib:master Oct 17, 2016
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.

5 participants