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

publish subscribes and connected-client #182

Merged
merged 3 commits into from
Aug 8, 2014
Merged

Conversation

mocheng
Copy link
Contributor

@mocheng mocheng commented Aug 7, 2014

Fix #92

Publish new client by default would break a lot of unit test cases. So, I add one server.options named publishNewClient to switch the feature, which is off by default.

@@ -241,10 +242,44 @@ function Server(opts, callback) {
}
]);

var SysNewTopic = "$SYS/broker-id/new/clients";
Copy link
Collaborator

Choose a reason for hiding this comment

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

broker-id should be built on the broker's id :).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right.
Do you prefer to having the published message only client id in string, or having it a JSON {clientId: xxxxx}?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer the client id in the string. However you may leave that in the JSON too, it does not harm.

@mcollina
Copy link
Collaborator

mcollina commented Aug 8, 2014

Good one! Do you think it's ready for merging and releasing?
I would love to release it today as 0.24.0 (I also bumped some dependencies on master).

@mocheng
Copy link
Contributor Author

mocheng commented Aug 8, 2014

We've deployed this change in our test environment today. There is no issue yet. It should work well.

Just not sure whether new published message would burden backend ascoltatori. In our env, about 10 connect/subscribe per second works well.

@mcollina
Copy link
Collaborator

mcollina commented Aug 8, 2014

I think you intended 'new subscribe' message.

What do you think about changing the default of publishNewClient to true (and setting it off in the settings for tests https://github.com/mcollina/mosca/blob/master/test/server.js#L7-L19). This is needed to make Redis, MongoDB and AMQP things MQTT-compliant.

@mocheng
Copy link
Contributor Author

mocheng commented Aug 8, 2014

That should be good.
Default on would make this feature well exposed to more users.
I'll update it.

@mocheng
Copy link
Contributor Author

mocheng commented Aug 8, 2014

Turn publishNewClient on by default. Several test files are updated to turn off publishNewClient in unit testing.

mcollina added a commit that referenced this pull request Aug 8, 2014
publish subscribes and connected-client
@mcollina mcollina merged commit e8c3858 into moscajs:master Aug 8, 2014
@mocheng mocheng deleted the fix_92 branch August 8, 2014 09:54
@mcollina
Copy link
Collaborator

mcollina commented Aug 8, 2014

Released as 0.24.0.

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

Successfully merging this pull request may close these issues.

publish subscribes and new client ids
2 participants