Open fas3r opened 5 years ago
Hi,
I also get this error. Looking /scserver.js
, it seems that the server does not try to require
the broker from the string
. Instead it seems to expect an instance to be handed over.
I tried passing new require('sc-broker-cluster'').Client()
, which gave me a new error:
TypeError: Cannot read property 'brokers' of undefined
at new module.exports.Client (/home/user/NodeJS/project/node_modules/sc-broker-cluster/index.js:438:25)
I do appreciate that the developers made a ready to go framework which handles this issue for you, but what I like about NodeJS is the flexibility of it`s modules. If it is possible, I do want to manage the processes on my own, even though this will lead to more work.
I also looked into the socketcluster
source code, but it was a bit hard to understand the whole process. Heck, I don't think I even found where multiple brokers are created. Once I have more time, I might give it another go, but for now, a minimal tutorial would be nice.
Look at the scc-cluster-broker
Hi @matth-c3 , do you mean sc-broker-cluster
?
I did, but I'm still not sure how to properly do it.
From my understanding, you run the sc-cluster-broker.Server
on a separate process and then pass the sc-cluster-broker.Client
to the socketcluster-server
, but I don''t quite understand the details behind it yet.
Hello,
Could it be possible to get some information or guidance on how to implement the sc-broker-cluster with the
socketcluster-server
?When I set the brokerEngine to 'sc-broker-cluster' in the options I'm getting the following error :