How can I update database table by using camel routing?

2011-11-15 Thread focaldi
I am developing a router that it will read data from integration table and after that it will update a column in integration table. my router is : from("timer://foo?period=6").setBody(constant("select * from AIRPORT")).to("jdbc:dataSource").to("jms:queue:airport"); I can see to sql resultse

Re: How can I update database table by using camel routing?

2011-11-15 Thread focaldi
it is ok but i dont like this solution :(. Beacuse I dont wan to use JDBCTEMPLATE for update column. Please show me a way for proper solution. public class RouteDatabaseToJms extends RouteBuilder { @Override public void configure() throws Exception {

Re: How can I update database table by using camel routing?

2011-11-15 Thread focaldi
Thank you for answer Claus Ibsen, if I would not solve by using jdbc, I will use JPA. Can I solve this problem with camel jdbc component? -- View this message in context: http://camel.465427.n5.nabble.com/How-can-I-update-database-table-by-using-camel-routing-tp4994243p4994400.html Sent from the

Re: How can I update database table by using camel routing?

2011-11-15 Thread focaldi
Thanks for your advice Christian, another thanks for Claus :)... I changed my code like below and it works fine. Now, I wanna ask another question : Which one is the best solution in your opinion? public class RouteDatabaseToJms extends RouteBuilder { @Override public void configur

Re: Update camel route at runtime using config admin

2011-11-30 Thread focaldi
Hi, Now, I am in a project like you. I didint run my project but I have to change my routes in runtime when myroutes.xml changed. If you want to change your routes at runtime you can use Java DSL and you can remove your routes camelContext.removeRoute and after remove old routes you can add changed

How can I define JMS Queue MessageListener Bean?

2011-11-30 Thread focaldi
Hi, I want to define a JMS queue messagelistener bean. I have a MessageListenerForAgentControl class that implements MessageListener interface and I override "onMessage" method. After all I added to a route like below : route = route.bean(MessageListenerForAgentControl.class); But when I added thi

Re: How can I define JMS Queue MessageListener Bean?

2011-11-30 Thread focaldi
Thanks William, I looked into the link. But I dont want to COMSUME message from a queue, I need to trigger a bean method when a message was came to queue. But it should not affect the routing I could not solve my problem yet... -- View this message in context: http://camel.465427.n5.nabble.c

Re: How can I define JMS Queue MessageListener Bean?

2011-11-30 Thread focaldi
Hey I solve my problem with "interceptor" :)... -- View this message in context: http://camel.465427.n5.nabble.com/How-can-I-define-JMS-Queue-MessageListener-Bean-tp5034816p5035718.html Sent from the Camel - Users mailing list archive at Nabble.com.

How can I split resultset that come from database?

2011-12-02 Thread focaldi
Hi, I am trying to split a resultset. My Route runs a select sql in database after that it will send all resultset in a message. But I need to split the resultset and send to queue row by row. Ho can I do this? Thanks all -- View this message in context: http://camel.465427.n5.nabble.com/How-can-

Re: How can I split resultset that come from database?

2011-12-02 Thread focaldi
Thanks my friend, I use "myroute.split(body())" and it works. Thanks both of you... -- View this message in context: http://camel.465427.n5.nabble.com/How-can-I-split-resultset-that-come-from-database-tp5041311p5041487.html Sent from the Camel - Users mailing list archive at Nabble.com.

Body clipped after 1000 chars, total length is ????

2011-12-02 Thread focaldi
Hi, I need to get some data from database. But I I took this message. I tried to all ExchangePatterns. But it dosnt work. Pls help me. Thanks [Body clipped after 1000 chars, total length is 7850]]. Caused by: [org.springframework.jms.MessageFormatException - Only objectified primitive objects, St

Re: Body clipped after 1000 chars, total length is ????

2011-12-02 Thread focaldi
Hi, I solved my problem. Before, I was using "Select ID, MESSAGE_BODY From MYTABLE" but I changed it like it and it works : Select TO_CHAR(ID) ID, TO_CHAR(MESSAGE_BODY) MESSAGE_BODY From MYTABLE. I guess it is waiting String for columnt type. For your information -- View this message in context:

How can I handle exception message?

2011-12-05 Thread focaldi
Hi, I want to do some special thing according to Exception Type. But there are a lot of route and when an exeption occured I send the message to deadletter queue. errorHandler( deadLetterChannel("jms:queue:deadletterqueue") ); I wrote a class for deadlette

Re: How can I handle exception message?

2011-12-05 Thread focaldi
Thanks my friends, but it didnt work :( In my main classs : ... camelContext.setHandleFault(true); ... My Dead Letter Queue URL : jms:queue:deadletterqueue Dead Letter Queueu Processor : from("jms:queue:deadletterqueue").process(new ProcessorForSendingEmail ()); Processor class for deadlett

Re: How can I handle exception message?

2011-12-05 Thread focaldi
Thanks Willem I used "seda:error" for deadletterurl and it works. Thanks for your help Willem and Claus... -- View this message in context: http://camel.465427.n5.nabble.com/How-can-I-handle-exception-message-tp5051151p5051307.html Sent from the Camel - Users mailing list archive at Nabble.com.

Deploy Camel project to Activemq

2011-12-13 Thread focaldi
Hi I am using Activemq 5.5.1 and I wanna deploy my camel application what it is adding dynamic routes and some datasource registry. But I couldnt add datasources to camel instance that provided by Active MQ. If I would use "camelContext = new DefaultCamelContext(registry);", I can register to camel

Re: Deploy Camel project to Activemq

2011-12-13 Thread focaldi
Thanks Willem but I didnt create another camelcontext. Just I want to use ActiveMQ camelcontext instance. So when I tried to add this context in java code, I couldnt find like "camelContext.addRegister" command. -- View this message in context: http://camel.465427.n5.nabble.com/Deploy-Camel-proje

Re: Deploy Camel project to Activemq

2011-12-13 Thread focaldi
Thanks Claus, but I am trying to add in ActiveMQ library. And my project has a myconfig.xml for configuration and I want to register datasources what defined in myconfig.xml to camelcontext. So I cannot use a jndi.properties file... May be I couldt explain what is my problem... -- View this messag

How can I convert Exchange message to TextMessage????

2011-12-14 Thread focaldi
Hi everybody, I m trying to convert Exchange message to TextMessage format. Beacuse the IX Agent consume a JMS endpoind and it understands TextMessage format. I need to convert message to TextMessage format in jmsqueue. How can I convert it? I can handle "JmsMessage" in P1 processor but I dont

Re: Deploy Camel project to Activemq

2011-12-14 Thread focaldi
Thanks Willem, but my config.xml is not spring base config. it is simple configuration file that it holds some information about application and route information. I couldnt solve my problem. So I created another Camel context object and I added my routes to this context object :)...Thanks your ans

Re: How can I convert Exchange message to TextMessage????

2011-12-14 Thread focaldi
Thanks all, I solved my problem in P1 processor. I added "inMsg.setHeader("CamelJmsMessageType", JmsMessageType.Text);" line to P1 processor and it works... My processor class is : public class ProcessorForConvertExchangeToJmsMessage implements Processor { @Override public void proc

How can I catch a response? (http component)

2011-12-14 Thread focaldi
Hi I am trying to read response body but I took an exception like this. Actually, I want to read http://tcmb.gov.tr/kurlar/today.xml url. But I couldt :(. Pls help me. Added to pom.xml : org.apache.camel camel-http 2.9.0-RC1 My route is : camelContext.addRoutes(new R

Re: How can I catch a response? (http component)

2011-12-14 Thread focaldi
I run it in Eclipse and I wrote a main method. package aero.tav.ib; import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge; import javax.jms.ConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.camel.CamelContext; import org

Re: How can I catch a response? (http component)

2011-12-15 Thread focaldi
Thanks your fast answer, I put a screenshot, you can see that I added httpclient jar. http://camel.465427.n5.nabble.com/file/n5076814/Untitled.png -- View this message in context: http://camel.465427.n5.nabble.com/How-can-I-catch-a-response-http-component-tp5076707p5076814.html Sent from th

Re: How can I catch a response? (http component)

2011-12-15 Thread focaldi
Hi Willem, I test it but it doesn't work. :(. I took the same exception. What is the problem? I checked for another httpclient.jar but there is not. You can control my pom.xml for dependencies. I made a new project to test http componenet. There isn't other camel componenet. My pom.xml is : /**

how can I use WHEN and multicast?

2011-12-18 Thread focaldi
Hi, I tried to use "when" option with multicast. For example, from("direct:start").choice() .when(god).multicast().to("jms:q1","jms:q2") .otherwise().to("jms:q3") But "multicast" didnt work. Messages just went to "jms:q2". What is my problem? Thanks -- View this message in context: http:/

Re: how can I use WHEN and multicast?

2011-12-18 Thread focaldi
Hey I solved my problem. I was wrong. This code is working fine. The problem was route id :)... -- View this message in context: http://camel.465427.n5.nabble.com/how-can-I-use-WHEN-and-multicast-tp5084304p5084402.html Sent from the Camel - Users mailing list archive at Nabble.com.