Solved

how to send optional TLV parameters using Camel / JSMPP

Posted on 2014-04-03
3
606 Views
Last Modified: 2014-04-14
Dear all,

We need to send optional TLV parameters using apache camel to operator. We are using Apache Servicemix 5.0 which has apache camel 2.12.3, running on ubuntu server.
We usually configure new transmitters using xml such as the below
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
         <from uri=""/>
           <setBody>
               <simple>${header.message}</simple>
           </setBody>
         <inOut uri="smpp://operator URI"/>
      </route>
    </camelContext>
</blueprint>

Open in new window


However now with this new requirement, I don't know how exactly I should set these optional TLV parameters when sending the SMS.

Thank you for your help,

Iyad
0
Comment
Question by:iyadFarah
  • 2
3 Comments
 
LVL 35

Expert Comment

by:mccarl
ID: 39976940
I haven't used camel too much, but by the looks of things you should just need to set the correct header on the message that gets sent to the SMPP component, and it has the built-in ability to recognize headers on the message and transform those to your TLV parameters, ie. something like this...
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
         <from uri=""/>
           <setBody>
               <simple>${header.message}</simple>
            <setHeader headerName="ADDITIONAL_STATUS_INFO_TEXT">Blah</setHeader>
           </setBody>
         <inOut uri="smpp://operator URI"/>
      </route>
    </camelContext>
</blueprint>

Open in new window

The supported Tag / Header names can be found as constants at the top of the DefaultSmppMarshaler class
0
 

Accepted Solution

by:
iyadFarah earned 0 total points
ID: 39990914
Thank you mccarl for your response. The solution is to use the latest version of Camel and set the header using a java class which can be injected in the xml.

Please refer to following JIRA ticket for more details:
https://issues.apache.org/jira/browse/CAMEL-6655
0
 

Author Closing Comment

by:iyadFarah
ID: 39998540
It is the correct solution
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
linux redhat 7.2 10 71
How yum repo uses sqlite3 to keep metadata about the repository? 2 34
maven module vs maven project 3 23
What's wrong with this code? 4 23
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question