Giter VIP home page Giter VIP logo

scc-broker's People

Contributors

jondubois avatar megagm avatar toredash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scc-broker's Issues

Which one does the work?

@jondubois hey man,

On the scc-broker, which one (worker,broker) does the work? Basically, we have an scc-broker instance on a 4 core machine. I'm wondering if I should do worker:4 or broker:4 or worker:2,broker:2.

Middleware Question

Is there a list of possible middlewares that can be attached to the broker? I would like to essentially only publish some set of messages to the clients connected to this broker. The reason for this is to provide essentially unlimited scalability. As the brokers increase then the number of message senders will increase with them.

What might solve my problem is just getting a list of currently collected clients that I can loop over and emit to those clients. I'm assuming that it's somewhere on the broker. I hope this makes sense.

Why worker.js in scc-broker?

In the guide over at "https://github.com/SocketCluster/socketcluster/blob/master/scc-guide.md" it says

The scc-broker service can be made up of any number of scc-broker instances - This is a special backend-only service which is designed to broker messages between multiple frontend-facing socketcluster instances. All the pub/sub channels in your entire system will be sharded evenly across available scc-broker instances. Just like with the socketcluster instances above, each scc-broker instance needs to point to a state server in order to work.

And the diagram shows that workers are part of the 'socketcluster' instances.

  1. Then why does an 'scc-broker' instance also contain a worker.js?
  2. Isn't the job of an 'scc-broker' only to be a broker (broker.js) and not a worker?
  3. If the 'scc-broker' instances do provide a httpworker, is the http workload balanced between the 'socketcluster' and the 'scc-broker' instances.
  4. Is it optional to have worker.js in 'scc-broker' instances.

Can you please clarify this?

NodeJS version 10: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system

I am using node v10.15.1.
When I run broker instance by:

SCC_STATE_SERVER_HOST='127.0.0.1' SCC_BROKER_SERVER_PORT='8888' node server

I got error as:

Origin: Worker (PID 51413)
   [Error] WSEngineInitError: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
    at native (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:40:21)
    at Object.<anonymous> (/Users/annguyen/workspace/sccp/scc-broker/node_modules/sc-uws/uws.js:46:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at new SCServer (/Users/annguyen/workspace/sccp/scc-broker/node_modules/socketcluster-server/scserver.js:106:54)

Undefined handshake

Hey,

When you clone the repo and add a AUTH_KEY it fails to add the handshake. Here is the code

Which one should I use? WS or SC?

 if (AUTH_KEY) {
      scServer.addMiddleware(scServer.MIDDLEWARE_HANDSHAKE, (req, next) => {
        var urlParts = url.parse(req.url, true);
        if (urlParts.query && urlParts.query.authKey == AUTH_KEY) {
          next();
        } else {
          var err = new Error('Cannot connect to the cluster broker server without providing a valid authKey as a URL query argument.');
          err.name = 'BadClusterAuthError';
          next(err);
        }
      });
    }

selection_034

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.