Git Product home page Git Product logo

Comments (7)

daper avatar daper commented on July 19, 2024

Checkout this framework http://www.actionherojs.com you can make a
framework server instance that wraps or connects with your smpp code. It's
cluster-ready. I'm working on this approach now.

On Thu, Apr 7, 2016, 2:32 PM Alexey Avramchik [email protected]
wrote:

I need to run several instances of the application.
How can i use node-smpp in the cluster mode (manually or for example
through pm2)? Or maybe use any loadbalancer (haproxy)?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#46

from node-smpp.

markitosgv avatar markitosgv commented on July 19, 2024

There's any problem with session when running with pm2 in cluster mode?

Im testing and all responses came from same process until session is closed. Then if a new connection is made by a client, maybe a new cluster can respond.

from node-smpp.

oozimok avatar oozimok commented on July 19, 2024

The library is good. A very necessary work in cluster mode.

from node-smpp.

joaodrp avatar joaodrp commented on July 19, 2024

@daper have you managed to get it working with actionhero?

from node-smpp.

PauloPhagula avatar PauloPhagula commented on July 19, 2024

I don't know if this applies as an answer, but I find myself in a situation where I need to support 3 different providers at the same time and I don't want to repeat the code, so what we did is since we've been using PM2 to manage the process we just add 2 more process instances with different configurations for each provider respectively.

PM2 process file uses the usual structure like this:

{
    "apps": [
        {
            "name": "smpp-provider-1",
            "script": "/srv/www/secret-product-name/smpp/app.js",
            "merge_logs": true,
            "error_file": "/srv/www/secret-product-name/log/smpp_provider-1_error.log",
            "out_file": "/srv/www/secret-product-name/log/smpp_provider-1_output.log",
            "watch": true,
            "env": {
                "NODE_ENV": "local",
                "TEST": true,
                "PROVIDER": "provider-1"
            },
            "env_production": {
                "NODE_ENV": "production",
                "PROVIDER": "provider-1"
            },
            "env_staging": {
                "NODE_ENV": "staging",
                "TEST": true,
                "PROVIDER": "provider-1"
            }
        },
        {
            "name": "smpp-provider-2",
            "script": "/srv/www/secret-product-name/smpp/app.js",
            "merge_logs": true,
            "error_file": "/srv/www/secret-product-name/log/smpp_provider-2_error.log",
            "out_file": "/srv/www/secret-product-name/log/smpp_provider-2_output.log",
            "watch": true,
            "env": {
                "NODE_ENV": "local",
                "TEST": true,
                "PROVIDER": "provider-2"
            },
            "env_production": {
                "NODE_ENV": "production",
                "PROVIDER": "provider-2"
            },
            "env_staging": {
                "NODE_ENV": "staging",
                "TEST": true,
                "PROVIDER": "provider-2"
            }
        },
        {
            "name": "smpp-provider-3",
            "script": "/srv/www/secret-product-name/smpp/app.js",
            "merge_logs": true,
            "error_file": "/srv/www/secret-product-name/log/smpp_provider-3_error.log",
            "out_file": "/srv/www/secret-product-name/log/smpp_provider-3_output.log",
            "watch": true,
            "env": {
                "NODE_ENV": "local",
                "TEST": true,
                "PROVIDER": "provider-3"
            },
            "env_production": {
                "NODE_ENV": "production",
                "PROVIDER": "provider-3"
            },
            "env_staging": {
                "NODE_ENV": "staging",
                "TEST": true,
                "PROVIDER": "provider-3"
            }
        }
    ]
}

This way we can start and stop each of the processes independently of the others. And within the app code we can fetch the env variable specifying the provider name and know which config file with usernames, passwords, endpoints and etc to pickup.

Hope it helps

from node-smpp.

daper avatar daper commented on July 19, 2024

@joaodrp sorry, I started the proyect becouse kannel did not support some tlvs, but now it does. So I never ended, and its in a ver early stage. But Who knows, someday i'll finish it :) then publish it in my github account.

from node-smpp.

juliangut avatar juliangut commented on July 19, 2024

Cluster mode is currently supported for plain connections to the server. There has been a merged PR to fix cluster mode for TLS servers. This will be available in next release

Closing this issue, feel free to reopen if needed

from node-smpp.

Related Issues (20)

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.