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

topic subscription always bind to amq.topic exchange #69

Open
ericln opened this issue Jun 29, 2016 · 1 comment
Open

topic subscription always bind to amq.topic exchange #69

ericln opened this issue Jun 29, 2016 · 1 comment

Comments

@ericln
Copy link

ericln commented Jun 29, 2016

I am trying to use bus.subscribe('', func...), I am wondering how i can assign the exchange name ? i tried it on the bus creation in the options params, but nothing seems to work

any idea?

@mateodelnorte
Copy link
Owner

This is probably a bug, in that it is defaulting to 'amq.topic' whenever subscribe options don't have the exchangeName provided. A better solution would probably be for me to assign this.exchangeName = options.exchangeName || options.bus.exchangeName; in pubsubqueue.js.

If you don't mind the syntax (temporarily, at least) you should be able to do something like the following to set the exchange in the internal pubsubqueue:

bus.publish('routing.key', { my: 'message' }, { exchangeName: 'new.topic.exchange' });

I'll take a look at updating

this.exchangeName = options.exchangeName || 'amq.topic';
to default to the bus exchangeName, when an override option is not provided.

Let me know how that works for you.

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

No branches or pull requests

2 participants