Question

I am working on SMS application for a company, that sends SMS messages (SUBMIT_SM command) and receives the response from the SMSC (SUBMIT_SM_RESP command) to indicates if it is delivered to the customer. I am using JSMPP API.

What is the best practice to connect to the SMSC server? Should I open one connection (one session) and use it through the whole application to send SMS messages (any memory leakage here)? Or should I connect/disconnect to/from the SMSC server every time I send SMS message (any delays here)?

Note that, we are sending about 1000-2000 SMS messages per hour. Also I noticed that JSMPP API receives the response message (SUBMIT_SM_RESP) only when the connection is open.

Was it helpful?

Solution

That depends on the connection implementation. If your connection won't "die" during a long break than use one connection as it will save you time openeing/closing per request.

If your application is multi-threaded (where more than one thread can send a message) I advice you to implement a connection pool mechanism (or use an available one which supports SMSC sessions).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top