camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johanes Soetanto <>
Subject Re: how to obtain camel-smpp submit message id
Date Tue, 11 Dec 2012 22:41:41 GMT
Hi Chris,

On 12 December 2012 06:52, Christian Müller <> wrote:
> The CamelSmppId is set in SmppSubmitSmCommand after the response is
> received from the SMPP. You probably check the header of the wrong message
> (in vs. out).

>From looking at the source code I could see that it is being set on
"CamelSmppId" header by SmppSubmitSmCommand, but seems like I can't
get the header out message. If I use the configuration below

<camel:route id="OutboundRoute" >
   <camel:from uri="outgoingSpringIntegrationChannel"/>
   <camel:to uri="smpp://pavel@localhost:1234?password=wpsd&amp;registeredDelivery=1&amp;..."/>
   <camel:bean ref="messageIdProcessor" method="process"/>

This is the logging that I receive
2012-12-12 09:00:53,825 DEBUG
[org.apache.camel.component.smpp.SmppSubmitSmCommand] Sending short
message 0 for exchange id 'ID-e6410-48817-1355263252153-0-2'...
2012-12-12 09:00:53,835 DEBUG
[org.apache.camel.component.smpp.SmppSubmitSmCommand] Sent short
message for exchange id 'ID-e6410-48817-1355263252153-0-2' and
received message ids '[Smsc2014]'
Dumping message headers IN
Message id ID-e6410-48817-1355263252153-0-1
Message Headers:
Key:timestamp Value:1355263253800
Dumping message OUT
Message id ID-e6410-48817-1355263252153-0-3
Message Headers is null

> The SmppDeliverReceipt also contains the CamelSmppId. With this id, you can
> correlate the asynchronous received response. You can check out the unit
> test if you have problems to get it working [1].

After further debugging it seems like there is a problem with camel
spring integration. it seems like the header from from camel-smpp is
not copied to spring integration message (siMessage). If I debug the
message at the processor. The message is instance of
which pass all the method calls to the siMessage, so the CamelSmppId
cannot be retrieved unless I temporarily set the siMessage to null.

 if (message instanceof SpringIntegrationMessage) {
                    SpringIntegrationMessage siCamelMessage =
siMessage = siCamelMessage.getMessage();
                    Map<String,Object> hhh = siCamelMessage.getHeaders();
                    log.debug("SMPP ID {}", hhh.get(SmppConstants.ID));

Is there a way copy this header without doing custom processor ? something like

<camel-si:copy-header header="CamelSmppId" />

Or there is something wrong with my approach?


> [1]
> Best,
> Christian
> On Tue, Dec 11, 2012 at 4:54 AM, Johanes Soetanto <>wrote:
>> logging

View raw message