camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Router logic
Date Wed, 06 Jan 2010 02:54:20 GMT
Hi,
I don't think camel-jpa consumer can update the row of table as you want.
So you may break the whole work into two parts.
First poll the data from old tables, transforming, verify, write to 
entity new table.
Second, update the old table row state with the new entity. (That could 
be that you use camel-jpa to poll the data from new table and update the 
stats of the old table).

Just my 2 cents.

Willem


vcheruvu 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-
> 


Mime
View raw message