Search code examples
jsmpp

What is the best practice to implement JSMPP in a JavaEE environment?


My question is of a design issue; In our JavaEE application running on Glassfish 3.1.2, we have an implementation of JSMPP code that send SMSs to customers. This code is using a third party SMS provider (SMSC) which provided us with IP, port and log on credentials.

How the code works: The code is composed of an EJB that opens a connection during startup(@postconstruct)

The problem: A session is lost/dropped/closed some how while the application is running and this causes a ResponseTimeoutException on attempt to call SMPPSession.submitShortMessage

My Question: What is the design that one should follow in order to reconnect/reopen this session. This seems like a common requirement and I hope some one has already done it here that can point me to the right direction.

Many Thanks


Solution

  • By Default connection timeout happens after 60000 ms, which is enough time to send sms at any stage. Why do you want to keep your connection open always. If you are not sending any messages, ideally your connection should not be open. If your EJB is starting your connection at startup, then there must be api exposed to check and recoonect later when needed. Connection timeout is standard approach for implementation. Tweaking your connection is possible but you should first analyze why do you want it at first place? Is it standard way of implementation or not?