Hi When you send to the JMS queue then you may want to send that either as - InOnly (aka fire and forget) - InOut (request reply over JMS)
See the following EIPs about that http://camel.apache.org/event-message.html http://camel.apache.org/request-reply.html So if you want fire and forget then you should do .to(ExchangePattern.InOnly, "jms:queue:incomingorders") On Tue, Mar 12, 2013 at 11:25 PM, takidean <takide...@hotmail.fr> 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. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen