Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Using mosca with RabbitMQ as a pub/sub backend #189

Closed
sahrizvi opened this issue Aug 26, 2014 · 4 comments
Closed

Using mosca with RabbitMQ as a pub/sub backend #189

sahrizvi opened this issue Aug 26, 2014 · 4 comments

Comments

@sahrizvi
Copy link

Hi Matteo! I am currently running RabbitMQ and Mosca on my local machine along with a few MQTT clients.
The MQTT clients connect to mosca just fine and are able to publish/subscribe messages normally.
However, RabbitMQ does not register any messaging traffic at all.
I am getting a feeling that Mosca is by-passing RabbitMQ completely.

My config file is as follows:

//moscaDemo.js
var pubsubsettings = {
  type: 'amqp',
  json: false,
  amqp: require('amqp'),
  exchange: 'ascolatore5672'
};


var settings = {
  port: 1883,
  backend: pubsubsettings
};

and I am running mosca from the CLI as follows:

mosca -v -c moscaDemo.js | bunyan

ALso, I have disabled the MQTT plugin for RabbitMQ as it was blocking port 1883 for mosca.
RabbitMQ is running fine and at default port 5672 (I checked the status in the Management Page)
Can you please point out what is wrong with my setup?

@mcollina
Copy link
Collaborator

How do you 'get the feeling'? RabbitMQ has really no feelings, it's not a real rabbit, and messages are passing or not.

rabbit

The easiest way to verify that, is starting up two mosca instances with the same `pubsubsettings' thing, but on different ports: if the two can communicate (you subscribe to one and publish on the other) everything works fine.

@sahrizvi
Copy link
Author

Hehehe...thanks for clarifying things for me! I was almost about to pass it some carrots as arguments while starting it. 😄
I tried the verification method you told above, but I am not able to communicate across different instances of Mosca. (Running on ports 1883, 1884). Individually each instance of Mosca is able to send and recieve messages.
I retried after creating a topic exchange named 'ascolatore5672' on RabbitMQ but that didn't help either.
I request you to please help me with this problem.

@mcollina
Copy link
Collaborator

The moscaDemo.js is the same as above?

You are missing

module.exports = settings

at the end.

However that triggers an issue introduced in the latest release.

I'm publishing 0.24.1 shortly to address that.

@sahrizvi
Copy link
Author

Thanks a lot Matteo! I had missed module.exports. Also, many thanks for the fix you did for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants