0

I want to maintain the pool JSMPP connection in order to send SMS. According to the requirement I need to define the MIN and MAX connection, but the current JSMPP library allow us to create a single connection.

/**
 * Default constructor of {@link SMPPSession}. The next action might be
 * connect and bind to a destination message center.
 * 
 * @see #connectAndBind(String, int, BindType, String, String, String, TypeOfNumber, NumberingPlanIndicator, String)
 */
public SMPPSession() {
    this(new SynchronizedPDUSender(new DefaultPDUSender(new DefaultComposer())), 
            new DefaultPDUReader(), 
            SocketConnectionFactory.getInstance());
}

How can i extend the JSMPP library for pool of connection.

Thanks

stacktome
  • 790
  • 2
  • 9
  • 32
  • "current JSMPP library allow us to create a single connection" - what happens if you try to create another connection? – Fildor May 09 '16 at 11:15
  • @Fildor well we can create multiple connection, like this way for(int i=0; i<10; i++) {SMPPSession outSession = new SMPPSession(); add in queue } . But i need to handle the connection by my self. If i able to create pool of connection using JSMPP i dont need to handle. JSMPP will take care of connection. – stacktome May 09 '16 at 11:20
  • And they are all usable concurrently? No weird errors? I mean, the lib is thread safe when using multiple connections? If so, then what is your exact problem? Writing the pooling? – Fildor May 09 '16 at 11:23
  • First hit for "Object pool example Java" on google: https://sourcemaking.com/design_patterns/object_pool/java Should be pretty close to your needs. – Fildor May 09 '16 at 11:27
  • @Fildor Its good to maintain the connection pool than creating connection as the way you said. If we maintain the connection pool, we dont need to worried about un wanted connection. – stacktome May 09 '16 at 11:28
  • @stacktome how did you solve it then? – Arpit Agrawal Jul 25 '18 at 09:18

0 Answers0