-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAMEL-20121 reconnect SMPP session after receiving Unbound #12046
Conversation
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
70672d7
to
2698e64
Compare
Hold on..... I changed the handling of unbound to reconnect instead of just closing the session as last-minute change, but didn't properly check if it really resolves my scenario. Looks like just closing the session and creating a fresh one next time an Exchange comes in might be a cleaner solution. How do you think it should behave? Directly reconnect or wait for the next exchange to send before establishing a new connection? |
Yeah I think the producer should wait for next message |
Seems like closing the session in the StateListener can trigger a bug in jSMPP: opentelecoms-org/jsmpp#193 |
@der-ambi are you able to work on the last bit |
@davsclaus as jsmpp will deadlock when closing the session from within the Session State Listener I have to either wait for a fix in jsmpp or introduce a new Background Task that will close the session asynchronously. But that will also require more code for proper synchronisation. |
Yes its of course best to have it fixed if possible in the underlying library. Is that team working on a fix ? |
I am trying to revive the discussion by proposing some patches.. let's see what happens |
Signed-off-by: Christian Ambach <[email protected]>
Signed-off-by: Christian Ambach <[email protected]>
Upstream jsmpp has accepted my patches and released a fixed version 3.0.1 |
) * update version of jsmpp to 3.0.1 Signed-off-by: Christian Ambach <[email protected]> * CAMEL-20121 reconnect SMPP session after receiving Unbind Signed-off-by: Christian Ambach <[email protected]> --------- Signed-off-by: Christian Ambach <[email protected]>
Description
The SMPP peer I am using Camel against sends an Unbind after an inactivity period of 60 seconds on the connection. This means that the logical connection has been terminated and (as I understand the SMPP spec) the peer that received the Unbind is supposed to terminate the connection as the session cannot be recovered.
SmppProducer/SmppConsumer don't react on this event and trying to send a SMS after receiving the Unbind ends up in exceptions (
org.apache.camel.component.smpp.SmppException: java.io.IOException: Cannot submitShortMessage while session 0f46dc52 in state UNBOUND
)This PR adds code to catch the UNBOUND event in both SmppProducer/SmppConsumer and also closes the previous test gap of the internalSessionStateListener being uncovered in tests.
Target
camel-3.x
, whereas Camel 4 uses themain
branch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTests
locally and I have committed all auto-generated changes