What's the error did you get? As you using using the ActiveMQ VM transport, you need to put the JMS client and the camel route into the same JVM.
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, March 13, 2013 at 6:25 AM, takidean wrote: > hi > i de developped some code in which i have to receive data from a server over > sockets then send it into an oracle data base i need some help ,i'm new in > apache camel someone give me his opinion about this: > public class Action { > > /** > * @param args > * @throws Exception > */ > public static void main(String[] args) throws Exception { > > CamelContext cnt = new DefaultCamelContext(); > ConnectionFactory connectionFactory =new > ActiveMQConnectionFactory("vm://localhost"); > > cnt.addComponent("jms",JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); > cnt.addRoutes(new MyRouteBuilder()); > > > cnt.start(); > Thread.sleep(1000); > cnt.stop(); > } > > /********route builder***********/ > public class MyRouteBuilder extends RouteBuilder{ > > /** > * @param args > */ > > @Override > public void configure() throws Exception { > > from("mina:tcp://--adress--?textline=true") > .to("jms:queue:incomingorders") > .to("bean:orderToSql") > .to("jdbc:oracle--wboard--"); > > } > > > } > /************ordertoOrale**********/ > public class orderToOracle { > public String toSql(@XPath("order/@name") String name, > @XPath("order/@amount") int amount, > @XPath("order/@customer") String customer) { > StringBuilder sb = new StringBuilder(); > sb.append("insert into incoming_orders "); > sb.append("(part_name, quantity, customer) values ("); > sb.append("'").append(name).append("', "); > sb.append("'").append(amount).append("', "); > sb.append("'").append(customer).append("') "); > return sb.toString(); > } > } > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/from-server-to-oracle-tp5729049.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).
