By careful, your targetEndpoint refers the same endpoint. Using camel,
you can avoid targetService and targetEndpoint (the routing will be made
by Camel using from routing).
Regards
JB
gardion1 wrote:
Hello,
I am trying to get use servicemix to receive messages via smpp and output
them to the terminal. I am using servicemix-smpp and servicemix-camel
compenents.
Here is the xbeans.xml file that I used for servicemix-smpp
<?xml version="1.0"?>
<beans xmlns:smpp="http://servicemix.apache.org/smpp/1.0"
xmlns:tut="urn:org:apache:servicemix:tutorial:testsmpp">
<smpp:consumer service="tut:smpp_service"
endpoint="endpoint"
host="agsbd02"
port="2775"
systemId="test"
password="test"
targetService="tut:smpp_service"
targetEndpoint="endpoint"/>
</beans>
With this configuration I can receive sms's from an smsc simulator. The
smpp component seems to give the appropriate responses to the smsc simulator
However, if I want to forward messages from smpp component in servicemix to
the console with camel routing I have problems. Here is my camel
configuration.
Under my camel su configuration I have the following java file
(MyRouteBuilder.java)
package org.apache.servicemix.aegis.smpp;
import javax.xml.transform.dom.DOMSource;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
/**
* A Camel Router
*
* @version $Revision: 1.1 $
*/
public class MyRouteBuilder extends RouteBuilder {
public void configure() {
from("jbi:endpoint:urn:org:apache:servicemix:tutorial:testsmpp:smpp:consumer")
// 1
.to("log:tutorial-jbi")
// 2
.convertBodyTo(DOMSource.class)
// 3
.to("log:tutorial-domsource")
// 2
.convertBodyTo(String.class)
// 3
.to("log:tutorial-string");
/*
from("timer://tutorial?fixedRate=true&delay=3000&period=10000") // 1
.setBody(constant("Hello world!")) //
2
.to("log:tutorial");
*/
}
}
The problems is I don't see anything from smpp on the console. If I comment
the first from statement and uncomment the second from timer section I see
hello world on the terminal. Can you see why I am not getting any messages
from smpp to the terminal?
In case it matters my camel-context.xml file looks like this
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
">
<!--
from("seda:a").to("seda:b");
-->
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<package>org.apache.servicemix.aegis.smpp</package>
</camelContext>
</beans>
<!-- END SNIPPET: camel -->
Thank you for any help you can offer.
Joel.