moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

amqp exchange setting #610

Closed buff closed 7 years ago

buff commented 7 years ago

Hi, I understand the client is to be used to setup non default host, port info. When I use it the exchange parameter does not seem to have any effect. If I don't use the client the exchange is created. I have tried using the defaultExchangeName property as well as the exchange property but none of these seem to have any effect. The broker does seem to be working but with a default exchange... possibly amq.topic

mcollina commented 7 years ago

You should probably check the internals in https://github.com/mcollina/ascoltatori.

buff commented 7 years ago

Seems to also imply that using the property 'exchange' is all that is required. My settings are: var pubsubSettings = { json: false, client: client, exchange: config.EXCHANGE_RABBIT, amqp: require('amqp') }; Where config.EXCHANGE_RABBIT is the exchange name... If I have the same properties without the client property I see the exchange is created.

buff commented 7 years ago

This can be closed... I found another reference to the settings. I misread the definition for the client. It is actually the options for the amqp.createConnection method. I was trying to pass the result of the method. Maybe an example with client should be added to the wiki?

mcollina commented 7 years ago

@buff would you like to add one?

buff commented 7 years ago

@mcollina No problem. I have not actually ever done so... What would I have to do?

mcollina commented 7 years ago

there is an edit button in the wiki page

buff commented 7 years ago

@mcollina done... I thought there was some more convoluted process...