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

Allow connecting with a string instead of an object #17

Merged
merged 8 commits into from
Nov 5, 2015

Conversation

jessehansen
Copy link
Contributor

Also removes amqp-uri since the object functionality is built into amqplib

Also removes amqp-uri since the object functionality is built into amqplib

module.exports = Binder;

function fixConnectionInfo(connectionInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a copy/paste of some non-trivial code. Can you consolidate it?

@ekyoung
Copy link
Contributor

ekyoung commented Nov 5, 2015

All the integration tests fail for me. I don't see any documentation about being able to pass an object into the connect method of amqplib. Are you sure that works?

@jessehansen
Copy link
Contributor Author

We ran into the same issue as this guy last night – which led me to this

amqp-node/amqplib#159

@ekyoung
Copy link
Contributor

ekyoung commented Nov 5, 2015

I see why the integration tests fail for me. The _test-env file has a non-standard user and vhost. Was that intentional or left in by mistake?

@jessehansen
Copy link
Contributor Author

What do your tests say when they fail? Mine work, but I'm running them in docker with RABBITMQ_HOST=docker.dev npm test

@jessehansen
Copy link
Contributor Author

Oops - yeah that was a mistake I had because I was verifying the connection details worked. I fixed that.

@ekyoung
Copy link
Contributor

ekyoung commented Nov 5, 2015

If you want to be compatible with amqp-uri, fixConnectionInfo should translate the ssl property to the protocol property. I think that's specified as false in all our apps that use this so far. See https://github.com/LeisureLink/legoland-adapter-api/blob/develop/lib/listeners/index.js

If you don't care about compatibility or causing breaking changes for those projects (they should all upgrade to 1.0 anyway) then I'd say get rid of fixConnectionInfo and just accept the amqplib format.

@jessehansen
Copy link
Contributor Author

Yeah you're right, we should just pass that through. I'll remove it and make a note in the docs.

@jessehansen
Copy link
Contributor Author

Ok the docs are updated to work with a string instead of an object. Seems like it's more clear that way anyway.

@@ -16,10 +16,10 @@ describe('Broker', function() {
var serviceDomainName = 'my-domain';
var appName = 'my-app';
var connectionInfo = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not important for these tests, but this is an inaccurate example of connectionInfo. Should be hostname and username.

ekyoung added a commit that referenced this pull request Nov 5, 2015
Allow connecting with a string instead of an object
@ekyoung ekyoung merged commit 84364db into master Nov 5, 2015
@ekyoung ekyoung deleted the allow-connection-string branch November 5, 2015 18:19
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.

2 participants