Hi When it comes to JDBC I prefer some simpler solutions using spring-jdbc (their JdbcTemplate) and sometimes iBatis.
Often JPA, Hibernate etc. is overkill for integration works where you need to work with a few tables and move/update rows. You can then do the logic in a simple POJO and have methods doing the actual work. Then its nice and simple. Then Camel should only help with triggering your POJO. The most important is often to get the SQL scripts correct and that their are fast and accurate. On Tue, Jan 5, 2010 at 8:08 AM, vcheruvu <[email protected]> wrote: > > Hi, > > I am trying to figure out if Camel can be used to achieve below scenario > > 1 . Poll each row updates from tables , mark if row processing successful > other wise mark as unread or Error if processing failed. This row processing > is marked completed only if it has completed 1,2 ,3 and 4. > > 2. tranform message to new entity for persisting. > > 3. Verify if Entity value exist in Look up table > 3a. If values doesn't exist, populate in xyz look up tables > > 4. write new Entity to new table > > So, to achieve above scenario, i have written sample router logic using > camel JAVA DSL but i am unsure how step 3 and 3a will be written in my > configure method. Please see my code as shown below. Please correct me if I > am wrong. > > public void configure() throws Exception { > // the following will dump the database to files > > from("jpa:com.entity.oldTableEntity?consumeDelete=false&delay=3000&consumeLockEntity=false") > // JPA polling consumer to get updates ..How does it update oldTableEntity > that row has been processed? > .beanRef("TrasnformerCalss","translatemethod") //message tranlator > to map it to an newTableEntity > .to("direct:LookUpTableCheck") // check entity field values exist in > look up tables.. how to add logic for writing to lookup table ?? Will this > be JPAProducer endpoint where more java logic code added ? > .to("jpa:com.mbl.entity.newTableEntity"); //JPAProducer write to > table > > } > > Can you please provide me some guidance on how to achieve above scenario > using Camel? I have looked at the Examples and uderstood basics of polling, > message translation , but it didn't cover much about > scenarios such as questions raised in the sample code above. Thanks in > advance > > Regards, > -Vid- > > -- > View this message in context: > http://old.nabble.com/Router-logic-tp27024502p27024502.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
