camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Bindy component: more than one model object per package
Date Mon, 12 Sep 2011 07:40:38 GMT
Hi

We would like to improve this in the future, either Camel 3.0, or earlier.
However we would like to avoid any big breakings and thus we need to
be a bit careful on the 2.x branch. For 3.0 we can of course make
bigger changes if it is indeed needed.

So you can have multiple model objects in the same package, and then
just pin point the "main" class in the DataFormat.
For example as JAXB works.

I think there is a JIRA ticket in there already for this.


On Mon, Sep 12, 2011 at 9:02 AM, c.spiegel <c.spiegel@waldmann.com> wrote:
> Is there any way, to tell Camel which model object to use during CSV
> unmarshalling?
>
> Following szenario:
> my.package:
>  -ModelObject1 (annotated with @CsvRecord)
>  -ModelObject2 (annotated with @CsvRecord)
>
> Both model object are totally different. I'm trying to poll a folder which
> includes different formated csv files:
>
> public void configure() throws Exception {
>                BindyCsvDataFormat dataFormat = new BindyCsvDataFormat("my.package");
>
>                from("file://data/csv?noop=true").split().body()
>                .unmarshal(dataFormat).process(new Processor() {
>
>                public void process(Exchange exchange) throws Exception {
>                        System.out.println(exchange.getIn());
>
>                }
>        });
> }
>
> Bindy fails with
> /java.lang.IllegalArgumentException: Some fields are missing (optional or
> mandatory), line : 1/
> because Bindy tries to bind to the wrong model object. Is there any way, to
> tell Bindy to which model object Bindy should bind to? The only workaround a
> found, is to put each model object in an own package (what is not very handy
> I think).
>
> Thanks for any help.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Bindy-component-more-than-one-model-object-per-package-tp4793295p4793295.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message