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

Providing a tag option prevents from joining the mesh #110

Open
danielo515 opened this issue Jun 17, 2018 · 1 comment
Open

Providing a tag option prevents from joining the mesh #110

danielo515 opened this issue Jun 17, 2018 · 1 comment

Comments

@danielo515
Copy link

danielo515 commented Jun 17, 2018

Hello,

For some reason I though that secena-mesh accepts a tag property on its options, therefore I set one. This worked fine for bases, they got up, discover each other and nothing fancy happens.
However, when I provide a tag property on a non-base node the node is not able to join the mesh.
No errors, no timeouts, no problem at all, is it that it is not visible on the mesh nor I can send messages to it.

Here is a basic stupid example:

'use strict';
const seneca = require ('seneca') ();
seneca.use ('mesh', {
    pin: 'role:api,cmd:*'
    , isbase: false
    , port: 0
    , host: '0.0.0.0'
    , bases: [ '127.0.0.1:39999', '127.0.0.1:39001' ]
    , tag: 'someTag'
}).ready (function ()
{

    console.log ('booted', this.start_time );
    seneca.add ('role:api,cmd:*', (msg, reply) =>
    {

        console.log (msg);
        reply (null, msg);
    });
});

If I comment the tag property, then it works as expected and it joins the mesh.
As I said, this works without problem for bases.

Any explanation ?
Regards

@danielo515
Copy link
Author

I think I found the problem.
I just had to read the code of seneca-mesh and sneeze (which is used by seneca-mesh).
According to sneeze documentation it accepts a tag option that behaves just like I suspected:

tag: null
You can have multiple Sneeze networks running at the same time. Each network can have its own tag. Members with different tags will ignore each other.

A tag of null means observe all other members, regardless of tag. This is what you need for base nodes, a repl, or monitoring - see below.

Seneca-mesh takes an undocumented tag property that pass to sneeze, hence the behavior I reported.
I was using the tag property when instantiating seneca and at some point I accidentally added it to the config of seneca-mesh too.

Hope this helps someone. You can close this issue or keep it open as a remind to add such documentation.

Regards

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

No branches or pull requests

1 participant