Hi

Maybe you can provide a patch / diff with the code change you propose.
Then its easier for us to follow what you mean?

On Tue, Jul 28, 2015 at 2:00 PM, imranrazakhan <imranrazak...@gmail.com> wrote:
> Hi,
>
> Please find below details of unbind bug of SMPP
>
> Suppose SMSC allowed one connection to client and due to any reason if
> session.unbindAndClose failed it will set session to null and dont retry to
> unbind.
>
> Connection/Session will remain open on SMSC till its TransactionTimeOut,
> mostly SMSc Admin set it to 5 to 10 mins.
>
> Following are snippet of org.apache.camel.component.smpp.SmppProducer and
> details are like
>
> 1- if for any reason Camel try to unbind connection and it got failed below
> code print log and set session=null in both success/fail cases.
> 2- After sending unbind it will try to reconnect.
> 3- As SMSc allowed 1 connection which was not unbinded successfull it will
> not allowed second connection so reconnect will get failed.
> 4- Camel call closesession on reconnection failure and will verify if
> session != null, as session is already null so this code will not send
> unbind again and apache camel will not able to get connection from SMSc
> until timeout happen on SMSc and this will results in 10 mins outage.
>
> private void  closeSession() {
>         if (session != null) {
>
> session.removeSessionStateListener(this.internalSessionStateListener);
>             try {
>                 Thread.sleep(1000);
>                 session.unbindAndClose();
>             } catch (Exception e) {
>               LOG.warn("Could not close session " + session);
>             }
>
>             session = null;
>
>         }
>
>     }
>
> #############################################
>
>  while (!(isStopping() || isStopped()) && (session == null ||
> session.getSessionState().equals(SessionState.CLOSED))) {
>
>  try {
>     LOG.info("Trying to reconnect to " + getEndpoint().getConnectionString()
> + " - attempt #" + (++attempt) + "...");
>
>                                 session = createSession();
>                                 reconnected = true;
>                                 } catch (IOException e) {
>
>                                 LOG.info("Failed to reconnect to " +
> getEndpoint().getConnectionString());
>
>                                 closeSession();
>
>                                 try {
>
>
> Thread.sleep(configuration.getReconnectDelay());
>
>                                 } catch (InterruptedException ee) {
>
>                                 }
>
>                             }
>
>                         }
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/unbind-bug-of-Apache-Camel-SMPP-tp5770008.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Reply via email to