Hello I have an app written in Kotlin and using Spring boot Framework and Apache Camel: https://camel.apache.org/components/latest/smpp-component.html#_spring_boot_auto_configuration
So I am new in Smpp protocol I am suppuse trying to connecto to SMC simulator so I guess my "client" should be wait for a message from SMC in this case when I run the application it appears just stop and anymore. As it just stops I would think something is wrong.
@Bean
fun camelContextConfiguration(): CamelContextConfiguration{
return object : CamelContextConfiguration {
override fun afterApplicationStart(camelContext: CamelContext?) {
logger.info("*********************************************************************************")
//var query : Query?
//val oldRoute : List<Route> = camelContext!!.routes
camelContext!!.routes
//logger.info("Old Routes")
//logger.info(oldRoute.size.toString())
// for(route:Route in oldRoute) {
// logger.info("Route with routeId {} is deleted",route.id)
// camelContext.stopRoute(route.id)
// camelContext.removeRoute(route.id)
// }
camelContext.isUseMDCLogging=true
logger.info("ROUTES")
val routeDefinition = RouteDefinition()
routeDefinition.id="1"
routeDefinition.onException(Exception::class.java).handled(true)
.process(exceptionProcessor())
.end()
routeDefinition.from("smpp://[email protected]:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemId=145244&systemType='Receiver'")
routeDefinition.to("log:com.app.smppdispenser.infraestructure.smpp?showBody=true&showHeaders=true")
routeDefinition.process(messageProcessor())
camelContext.addRouteDefinition(routeDefinition)
//routeDefinition.setHeader("CamelSmppCommandId", constant("query_sm"))
//routeDefinition.setHeader("CamelSmppSequenceNumber", constant("1"))
logger.info("Route is added with routeId {} ",routeDefinition.id)
//}
logger.info("CamelConfiguration afterApplicationStart OK")
}
override fun beforeApplicationStart(camelContext: CamelContext?) {
logger.info("CamelConfiguration beforeApplicationStart")
}
}
}
This is the log>
2021-06-06 10:37:06.824 INFO 5604 --- [ main] o.a.c.s.boot.CamelContextConfiguration : ROUTES 2021-06-06 10:37:07.538 INFO 5604 --- [ main] org.jsmpp.session.SMPPSession : Connected to smscsim.melroselabs.com/18.200.51.80 2021-06-06 10:37:07.541 INFO 5604 --- [ession@31859960] org.jsmpp.session.SMPPSession : Starting PDUReaderWorker 2021-06-06 10:37:07.817 INFO 5604 --- [
main] org.jsmpp.session.SMPPSession : Other side reports SMPP interface version 34 2021-06-06 10:37:07.817 INFO 5604 --- [
main] org.jsmpp.session.SMPPSession : Changing processor degree to 3 2021-06-06 10:37:07.819 INFO 5604 --- [ main] o.a.camel.component.smpp.SmppConsumer : Connected to: smpp://[email protected]:2775 2021-06-06 10:37:07.820 INFO 5604 --- [ main] o.a.camel.spring.SpringCamelContext
: Route: 1 started and consuming from: smpp://[email protected]:2775?enquireLinkTimer=3000&password=xxxxxx&systemId=145244&systemType=%27Receiver%27&transactionTimer=5000 2021-06-06 10:37:07.821 INFO 5604 --- [ main] o.a.c.s.boot.CamelContextConfiguration : Route is added with routeId 1 2021-06-06 10:37:07.821 INFO 5604 --- [ main] o.a.c.s.boot.CamelContextConfiguration : CamelConfiguration afterApplicationStart OK 2021-06-06 10:37:07.936 INFO 5604 --- [
Thread-2] o.s.w.c.s.GenericWebApplicationContext : Closing org.springframework.web.context.support.GenericWebApplicationContext@2cf3d63b: startup date [Sun Jun 06 10:36:55 COT 2021]; root of context hierarchy 2021-06-06 10:37:07.944 INFO 5604 --- [ Thread-2] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647 2021-06-06 10:37:07.945 INFO 5604 --- [ Thread-2] o.a.camel.spring.SpringCamelContext : Apache Camel 2.20.1 (CamelContext: camel-1) is shutting down 2021-06-06 10:37:07.946 INFO 5604 --- [ Thread-2] o.a.camel.impl.DefaultShutdownStrategy : Starting to graceful shutdown 1 routes (timeout 300 seconds) 2021-06-06 10:37:08.163 WARN 5604 --- [ession@31859960] org.jsmpp.session.SMPPSession : IOException while reading: Socket Closed 2021-06-06 10:37:08.164 INFO 5604 --- [ - ShutdownTask] o.a.camel.component.smpp.SmppConsumer : Disconnected from: smpp://[email protected]:2775 2021-06-06 10:37:08.164 INFO 5604 --- [ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy : Route: 1 shutdown complete, was consuming from: smpp://[email protected]:2775?enquireLinkTimer=3000&password=xxxxxx&systemId=145244&systemType=%27Receiver%27&transactionTimer=5000 2021-06-06 10:37:08.165 INFO 5604 --- [ession@31859960] org.jsmpp.session.SMPPSession : PDUReaderWorker stop 2021-06-06 10:37:08.166 INFO 5604 --- [ Thread-2] o.a.camel.impl.DefaultShutdownStrategy : Graceful shutdown of 1 routes completed in 0 seconds 2021-06-06 10:37:08.202 INFO 5604 --- [ Thread-2] o.a.camel.spring.SpringCamelContext : Apache Camel 2.20.1 (CamelContext: camel-1) uptime 1.629 seconds 2021-06-06 10:37:08.203 INFO 5604 --- [ Thread-2] o.a.camel.spring.SpringCamelContext : Apache Camel 2.20.1 (CamelContext: camel-1) is shutdown in 0.257 seconds Process finished with exit code 0
Edit I have added thse option: camel.springboot.main-run-controller = true then I see this new line in my log but it finish of the same way.