arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
276 stars 129 forks source link

Separation of rabbot instances #172

Open OSN64 opened 6 years ago

OSN64 commented 6 years ago

Rabbot seems to only use one client/connection per application instance. When the module is required multiple times, each instance cant be configured to a separate server. They all use the same server, even after .configure has been called.

An example of this.

const rabbot_1 = require('rabbot');
const rabbot_2 = require('rabbot');

rabbot_1.configure({server1});
rabbot_2.configure({server2});

rabbot_2.publish({'ex.1', { type: 'MyMessage', body: 'hello!' }); // pushes message to server 1
rabbot_2.shutdown(); // closes the connection to server 1