How to do that in Camel XML (again) ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to do that in Camel XML (again) ?

pascal J
How would you express the following using the Camel XML language ?

// START SNIPPET: example
public class EtlRoutes extends SpringRouteBuilder {
    public void configure() throws Exception {
        from("file:src/data?noop=true").convertBodyTo(PersonDocument.class)
        //  .intercept(transactionInterceptor())
            .to("jpa:org.apache.camel.example.etl.CustomerEntity");

        // the following will dump the database to files
        from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=false?consumer.delay=3000&consumeLockEntity=false")
            .setHeader(FileComponent.HEADER_FILE_NAME, el("${in.body.userName}.xml"))
            .to("file:target/customers?append=false");
    }
}
// END SNIPPET: example


I am expecially interrested by the convertBody(), the intercept() and the setHeader() functionality.

TIA.

Pascal J.
Reply | Threaded
Open this post in threaded view
|

Re: How to do that in Camel XML (again) ?

pascal J
Please help .

The answer might be completely obvious for the majority of you, but I'm still stuck on this one.

Pascal J.
Reply | Threaded
Open this post in threaded view
|

Re: How to do that in Camel XML (again) ?

jstrachan
In reply to this post by pascal J
On 18/10/2007, pascal J <[hidden email]> wrote:

>
> How would you express the following using the Camel XML language ?
>
> // START SNIPPET: example
> public class EtlRoutes extends SpringRouteBuilder {
>     public void configure() throws Exception {
>         from("file:src/data?noop=true").convertBodyTo(PersonDocument.class)
>         //  .intercept(transactionInterceptor())
>             .to("jpa:org.apache.camel.example.etl.CustomerEntity");
>
>         // the following will dump the database to files
>
> from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=false?consumer.delay=3000&consumeLockEntity=false")
>             .setHeader(FileComponent.HEADER_FILE_NAME,
> el("${in.body.userName}.xml"))
>             .to("file:target/customers?append=false");
>     }
> }
> // END SNIPPET: example
>
>
> I am expecially interrested by the convertBody(), the intercept() and the
> setHeader() functionality.

We've not ported those over yet to the XML language; so until then you
need to register the Processor for these steps in your spring.xml and
use <process ref="name"/> to use those.

--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: How to do that in Camel XML (again) ?

jstrachan
In reply to this post by pascal J
Have raised a JIRA to track this one:
https://issues.apache.org/activemq/browse/CAMEL-195

On 18/10/2007, pascal J <[hidden email]> wrote:

>
> How would you express the following using the Camel XML language ?
>
> // START SNIPPET: example
> public class EtlRoutes extends SpringRouteBuilder {
>     public void configure() throws Exception {
>         from("file:src/data?noop=true").convertBodyTo(PersonDocument.class)
>         //  .intercept(transactionInterceptor())
>             .to("jpa:org.apache.camel.example.etl.CustomerEntity");
>
>         // the following will dump the database to files
>
> from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=false?consumer.delay=3000&consumeLockEntity=false")
>             .setHeader(FileComponent.HEADER_FILE_NAME,
> el("${in.body.userName}.xml"))
>             .to("file:target/customers?append=false");
>     }
> }
> // END SNIPPET: example
>
>
> I am expecially interrested by the convertBody(), the intercept() and the
> setHeader() functionality.
>
> TIA.
>
> Pascal J.
>
> --
> View this message in context: http://www.nabble.com/How-to-do-that-in-Camel-XML-%28again%29---tf4647505s22882.html#a13276113
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com