Solved

how to send optional TLV parameters using Camel / JSMPP

Posted on 2014-04-03
3
595 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
Comment Utility
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
Comment Utility
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
Comment Utility
It is the correct solution
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now