One Star

Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi,
I interessting by implemeting this quite (?) simple scenario in Talend ESB with no luck. Hope i will get some help/advice.
My purpose is to create a kind of web service that enables me to send sms messages, via smpp protocol.
I plan to use a route, starting by a cCXF component (that will provide the web service) and route the requests to cMessagingEndPoint that wil use a camel smpp component to send sms. The required information of SMS will be provided by user requests on the webservice.

First i would like to get some feed back about the idea : shoud it be done this way ?
Second, if i'm doing right how shoud i do to dynamically send SMS to diffrent terminal numbers ? I far as i undrestand, I should specify these numbers as option in the URI of my endpoint component, but i didn't find how to make them dynamic (may be a hint is to use context variable, but i didnt manage to make it work).

I using TOS for ESB 5.0.2.r78327
Thanks,
WasYou
7 REPLIES
Employee

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi WasYou,
Your idea sounds reasonable. And you are correct in your assumption that you could use a context variables in Routes too the same way it is used in Jobs. Later on you could use an OSGi configuration admin service to change context parameter values.
Renat
One Star

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi,
Thanks for the quick reply. It seems i didnt waste my time with a wrong approach!
Okey, now can i have some advice or tips on how to handle context variable within routes ?
This is what i tried until now without a success :
I create a route with two context parameter lets say srcNum and DestNum. The parameter value is planned to change with every call to the provided webserive.
I have 3 componentsin my route :
cCXF --> cProcessor --> cMessagingEndPoint
- I do use the same cCXF compenent that is provided by ContentBasedRouting example available in ESBDEMO
- cProcessor is used to display the value of the contexte parameters
System.out.println("srcNum = "+context.getProperty("srcNum"));
System.out.println("DestNum = "+context.getProperty("DestNum"));
- cMessagingEndPoint is configured with this URI :
"smpp://user@127.0.0.1:2775?password=user&systemType=producer&sourceAddr="+context.srcNum+"&destAddr="+context.DestNum
I launch the execution in TOS, and that provides the webservice.
I try to call the webserivce from SOAPUI wtih this URL :
http://localhost:8021/services/BeanAsService?args=--context-param SrcNum=1010&DestNum=8888

What i do get is a message that is following my route, but the context values still always null. They didnt change.
I guess i'm not using the correct form to provide a value for my context params, but i d'ont know to fix this.
Any help or Tip ?
Thanks in advance,
WasYou.
One Star

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi again,
I managed to do it.
I changed my approach to be coherante with esb, by altering message header and message body.
Thanks for help and for the great product !
One Star

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi mwasyou,
I am about to do exactly the same thing. Would it be possible for you to explain how you managed to get it right? I know this post is old but hopefuly you still see this.
Thanks.
One Star

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

If anyone would like to know how I managed to accomplish this please email me and I will be happy to let you know how Smiley Happy. Its actually quite simple.
Four Stars

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi,

 

I developped a route using cMessaging endpoint to send an SMS:

1) I got the senderId, receiverId and the text of the sms from a cJMS which is separated by "|"

2) using cProcessor to get each params and set  as exchange.getIn().setBody(message);

3) cMessagingEndpoint to connect to smpp: "smpp://user@host:2775?password=pass&systemType=producer&sourceAddr="+context.senderId+"&destAddr="+context.receiverId

 

When I run it, there is no error but the sms is not sent. I don't know why I don't received the sms.

And even in the log, the SMPPSession has connected as status. See below the logs:

 

10:28:55,495 | INFO | xtenderThread-78 | pport.DefaultListableBeanFactory 603 | 252 - org.apache.servicemix.bundles.spring-beans - 3.2.14.RELEASE_1 | Pre-instantiatin
g singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1fdc670d: defining beans [jmxEventNotifier,Envoi_CamelSMPP.properties,route,mobile_
banking.envoi_camelsmpp_0_1.Envoi_CamelSMPP:beanPostProcessor,mobile_banking.envoi_camelsmpp_0_1.Envoi_CamelSMPP]; root of factory hierarchy
10:28:55,497 | INFO | xtenderThread-78 | .AbstractCamelContextFactoryBean 260 | 193 - org.apache.camel.camel-spring - 2.16.3 | Using custom EventNotifier with id: jmx
EventNotifier and implementation: org.apache.camel.management.JmxNotificationEventNotifier@34e41988
10:28:55,506 | INFO | xtenderThread-78 | e.camel.impl.DefaultCamelContext 2760 | 187 - org.apache.camel.camel-core - 2.16.3 | Apache Camel 2.16.3 (CamelContext: mobile
_banking.envoi_camelsmpp_0_1.Envoi_CamelSMPP) is starting
10:28:55,506 | INFO | xtenderThread-78 | gement.ManagedManagementStrategy 191 | 187 - org.apache.camel.camel-core - 2.16.3 | JMX is enabled
10:28:55,508 | INFO | 63)-192.168.8.30 | odules.audit.LogAuditLoginModule 57 | 46 - org.apache.karaf.jaas.modules - 4.0.5 | Authentication attempt - tadmin
10:28:55,508 | INFO | 63)-192.168.8.30 | odules.audit.LogAuditLoginModule 57 | 46 - org.apache.karaf.jaas.modules - 4.0.5 | Authentication succeeded - tadmin
10:28:55,514 | WARN | xtenderThread-78 | rg.apache.camel.util.CamelLogger 186 | 187 - org.apache.camel.camel-core - 2.16.3 | Overriding type converter from: StaticMet
hodTypeConverter: public static org.apache.activemq.command.ActiveMQDestination org.apache.activemq.camel.converter.ActiveMQConverter.toDestination(java.lang.String) to
: StaticMethodTypeConverter: public static org.apache.activemq.command.ActiveMQDestination org.apache.activemq.camel.converter.ActiveMQConverter.toDestination(java.lang
.String)
10:28:55,515 | WARN | xtenderThread-78 | rg.apache.camel.util.CamelLogger 186 | 187 - org.apache.camel.camel-core - 2.16.3 | Overriding type converter from: InstanceM
ethodTypeConverter: public org.apache.activemq.command.ActiveMQMessage org.apache.activemq.camel.converter.ActiveMQMessageConverter.toMessage(org.apache.camel.Exchange)
throws javax.jms.JMSException to: InstanceMethodTypeConverter: public org.apache.activemq.command.ActiveMQMessage org.apache.activemq.camel.converter.ActiveMQMessageCo
nverter.toMessage(org.apache.camel.Exchange) throws javax.jms.JMSException
10:28:55,515 | WARN | xtenderThread-78 | rg.apache.camel.util.CamelLogger 186 | 187 - org.apache.camel.camel-core - 2.16.3 | Overriding type converter from: InstanceM
ethodTypeConverter: public org.apache.camel.Processor org.apache.activemq.camel.converter.ActiveMQMessageConverter.toProcessor(javax.jms.MessageListener) to: InstanceMe
thodTypeConverter: public org.apache.camel.Processor org.apache.activemq.camel.converter.ActiveMQMessageConverter.toProcessor(javax.jms.MessageListener)
10:28:55,520 | INFO | xtenderThread-78 | l.DefaultRuntimeEndpointRegistry 203 | 187 - org.apache.camel.camel-core - 2.16.3 | Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
10:28:55,546 | INFO | xtenderThread-78 | e.camel.impl.DefaultCamelContext 2998 | 187 - org.apache.camel.camel-core - 2.16.3 | AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
10:28:55,546 | INFO | xtenderThread-78 | e.camel.impl.DefaultCamelContext 3008 | 187 - org.apache.camel.camel-core - 2.16.3 | StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
10:28:55,604 | INFO | xtenderThread-78 | org.jsmpp.session.SMPPSession 222 | 1648 - org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Connected
10:28:55,613 | INFO | Thread-10428 | sion.SMPPSession$PDUReaderWorker 537 | 1648 - org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Starting PDUReaderWorker with processor degree:3 ...
10:28:55,736 | INFO | xtenderThread-78 | amel.component.smpp.SmppProducer 103 | 1647 - org.apache.camel.camel-smpp - 2.16.3 | Connected to: smpp://talendsos@192.168.183.75:2775

10:28:55,736 | INFO | Thread-10429 | on.SMPPSession$EnquireLinkSender 596 | 1648 - org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Starting EnquireLinkSender

 

Four Stars

Re: Dynamic URI endpoint for cMessagingEndPoint (SMPP) in ESB

Hi,

 

Can anyone knows how to do a SUMBMIT_SM using cMessagingEndpoint as smpp component? 

It seems that this is the reason why the sms is not sent....

 

Thanks.