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

fix issue #22 #47

Merged
merged 6 commits into from
Nov 30, 2021
Merged

fix issue #22 #47

merged 6 commits into from
Nov 30, 2021

Conversation

fmsy
Copy link
Contributor

@fmsy fmsy commented Nov 30, 2021

allow running aedes on shared redis pub-sub by adding a topic prefix to prevent foreign pub-sub messages from interfering with aedes´s assert()ions

const { MQEmitterRedisPrefix } = require('mqemitter-redis');
const myprefix = 'mqemitter_prefix/';
mq = new MQEmitterRedisPrefix(myprefix, {
port: this.mqttBrokerOptions.redisPort,
host: this.mqttBrokerOptions.redisHost,
db: 12
});

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Can you please add a unit test?

const t = this.#pubSubPrefix+topic;
cb[this.#proxiedCallback] = (packet, cbcb) => {
// if (!(packet.topic.startsWith(this.#pubSubPrefix)))
// debugger;
Copy link
Owner

Choose a reason for hiding this comment

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

please removed these commented lines

@mcollina
Copy link
Owner

Can you please rebase? I had to reconfigure CI in #48.

allow running aedes on shared redis pub-sub by adding a topic prefix to prevent foreign pub-sub messages from interfering with aedes´s assert()ions

const { MQEmitterRedisPrefix } = require('mqemitter-redis');
const myprefix = 'mqemitter_prefix/';
mq = new MQEmitterRedisPrefix(myprefix, {
	port: this.mqttBrokerOptions.redisPort,
	host: this.mqttBrokerOptions.redisHost,
	db: 12
});
@mcollina
Copy link
Owner

CI is failing with this, could you take a look?

@fmsy
Copy link
Contributor Author

fmsy commented Nov 30, 2021

do you want me to squash all commits into one?

@mcollina
Copy link
Owner

No need, I'll do it on release.

function MQEmitterRedisPrefix (pubSubPrefix, options) {
MQEmitterRedis.call(this, options)
this._pubSubPrefix = pubSubPrefix
this._sym_proxiedCallback = '_private_symbol_MQEmitterRedisPrefix_proxiedCallback' // Symbol('proxiedCallback');
Copy link
Owner

Choose a reason for hiding this comment

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

Could you use the Symbol instead?

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit acb40ea into mcollina:master Nov 30, 2021
@fmsy fmsy deleted the patch-1 branch November 30, 2021 12:13
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.

3 participants