Comments (7)
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.
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.
The library is good. A very necessary work in cluster mode.
from node-smpp.
@daper have you managed to get it working with actionhero?
from node-smpp.
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.
@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.
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)
- node-smpp as a proxy (Help) HOT 1
- Client not Connected HOT 1
- define wait-ack
- Crash when short_message misstype
- Pdu command length error HOT 2
- Support for user-defined TLVs
- Addition of more example on node-smpp usage HOT 10
- error on send pdu HOT 2
- Command status codes related to official SMPP Spec Error Codes
- Getting invalid password response from SMPP Server HOT 1
- Node client crash with ECONNRESET HOT 5
- Couldn't recieve SMS from SMSC HOT 7
- Differntiate between incoming message and an incoming message that gets triggered after a message is sent using smpp HOT 2
- Error while connecting to server PDU_STATUS 15 HOT 3
- connection issue when setting up the smpp server. HOT 6
- Getting esm_class === 4 for every sent SMS HOT 2
- [Support] total received DLR and Submit response vs total sent SMS
- message_payload or UDH header HOT 1
- Client Not reciving DLR Report
- Only one message recieved when multiple messages are sent. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-smpp.