Solved

how to send optional TLV parameters using Camel / JSMPP

Posted on 2014-04-03
3
621 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jmss example java 2 31
I NEED A "BARE" LINUX ... 9 84
glassfish admin console 1 16
Unix Help with:  mailx -s 17 57
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three thingsā€¦
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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.

685 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