Re: Bindy

2010-06-08 Thread Christian Müller
Hello Russ,

I'm afraid, there is no undocumented pattern to remove whitespaces.
I think we have to extend the
'org.apache.camel.dataformat.bindy.annotation.DataField' for this
requirement. Feel free to raise a JIRA issue for this:
https://issues.apache.org/activemq/browse/CAMEL

And to quote Claus, we love contributions... :-)

Regards,
Christian

On Tue, Jun 8, 2010 at 4:15 PM, Pitre, Russell  wrote:

> I'm using Bindy for processing CSV files and running into a situation
> where one of my Integer fields has whitespace in that position in the
> CSV file.  Is there any way to get pass this error?  Is there an
> undocumented pattern to remove whitespace?
>
>
>
>
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 1, Data : GLT, Field type : class java.lang.String
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 2, Data : 1-00-00-12500, Field type : class java.lang.String
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 3, Data : 05/30/2010, Field type : class java.util.Date
>
> 08:52:53 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 4, Data :   , Field type : class java.lang.Integer
>
> 08:52:53 DEBUG [org.apache.camel.processor.DefaultErrorHandler] Failed
> delivery for exchangeId: 9b099be4-b8c6-49b2-acd4-a71cf12dd614. On
> delivery attempt: 0 caught: java.lang.IllegalArgumentException: String
> provided does not fit the Integer pattern defined or is not parseable,
> position : 4, line : 1
>
> 08:52:53 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed
> delivery for exchangeId: 9b099be4-b8c6-49b2-acd4-a71cf12dd614. Exhausted
> after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
> String provided does not fit the Integer pattern defined or is not
> parseable, position : 4, line : 1
>
> java.lang.IllegalArgumentException: String provided does not fit the
> Integer pattern defined or is not parseable, position : 4, line : 1
>
>  at
> org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.j
> ava:194)
>
>  at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(Bindy
> CsvDataFormat.java:153)
>
>  at
> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor
> .java:51)
>
>
>
>
>
>
>
> -Russ
>
>


RE: Bindy

2010-06-09 Thread Pitre, Russell
Ok just might take a stab at it.


Thanks.

-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Tuesday, June 08, 2010 6:02 PM
To: users@camel.apache.org
Subject: Re: Bindy

Hello Russ,

I'm afraid, there is no undocumented pattern to remove whitespaces.
I think we have to extend the
'org.apache.camel.dataformat.bindy.annotation.DataField' for this
requirement. Feel free to raise a JIRA issue for this:
https://issues.apache.org/activemq/browse/CAMEL

And to quote Claus, we love contributions... :-)

Regards,
Christian

On Tue, Jun 8, 2010 at 4:15 PM, Pitre, Russell  wrote:

> I'm using Bindy for processing CSV files and running into a situation
> where one of my Integer fields has whitespace in that position in the
> CSV file.  Is there any way to get pass this error?  Is there an
> undocumented pattern to remove whitespace?
>
>
>
>
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 1, Data : GLT, Field type : class java.lang.String
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 2, Data : 1-00-00-12500, Field type : class java.lang.String
>
> 08:52:52 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 3, Data : 05/30/2010, Field type : class java.util.Date
>
> 08:52:53 DEBUG [org.apache.camel.dataformat.bindy.BindyCsvFactory] Pos :
> 4, Data :   , Field type : class java.lang.Integer
>
> 08:52:53 DEBUG [org.apache.camel.processor.DefaultErrorHandler] Failed
> delivery for exchangeId: 9b099be4-b8c6-49b2-acd4-a71cf12dd614. On
> delivery attempt: 0 caught: java.lang.IllegalArgumentException: String
> provided does not fit the Integer pattern defined or is not parseable,
> position : 4, line : 1
>
> 08:52:53 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed
> delivery for exchangeId: 9b099be4-b8c6-49b2-acd4-a71cf12dd614. Exhausted
> after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
> String provided does not fit the Integer pattern defined or is not
> parseable, position : 4, line : 1
>
> java.lang.IllegalArgumentException: String provided does not fit the
> Integer pattern defined or is not parseable, position : 4, line : 1
>
>  at
> org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.j
> ava:194)
>
>  at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(Bindy
> CsvDataFormat.java:153)
>
>  at
> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor
> .java:51)
>
>
>
>
>
>
>
> -Russ
>
>


Re: Bindy

2013-04-23 Thread Steve Forsyth
Try dropping the .getPackage().getName()

> BindyCsvDataFormat(UspsTrackRecord.class);




On Apr 23, 2013, at 12:30 AM, sandeep  wrote:

> I am trying to convert an CSV file to XML
> route look like 
> 
> BindyCsvDataFormat  bindy = new
> BindyCsvDataFormat(UspsTrackRecord.class.getPackage().getName());
> from(fromLocation)
>  .unmarshal(bindy)
>  .marshal()
>  .xstream()
>  .to(localDir);
> 
> but i get error:
> 12:48:08,965 ERROR [org.apache.camel.processor.DefaultErrorHandler] (Camel
> (camel-3) thread #2 - file://D:/data/backoffice-tracking/usps/) Failed
> delivery for (MessageId: ID-NOISA019PA-L1-54360-1366701454968-2-1 on
> ExchangeId: ID-NOISA019PA-L1-54360-1366701454968-2-2). Exhausted after
> delivery attempt: 1 caught: java.lang.IllegalArgumentException: The
> separator has not been defined in the annotation @CsvRecord or not
> instantiated during initModel. must be specified:
> java.lang.IllegalArgumentException: The separator has not been defined in
> the annotation @CsvRecord or not instantiated during initModel. must be
> specified
> 
> data class is
> 
> @XmlRootElement
> @XmlAccessorType(XmlAccessType.FIELD)
> @CsvRecord(separator = ",",crlf = "UNIX")
> public class UspsTrackRecord implements Serializable {
>@XmlAttribute
>@DataField(pos = 1)
>private String version;
> 
>public String getPackageID() {
>return packageID;
>}
> 
>public void setPackageID(String packageID) {
>this.packageID = packageID;
>}
> 
>public String getVersion() {
>return version;
>}
> 
>public void setVersion(String version) {
>this.version = version;
>}
> 
>@XmlAttribute
>@DataField(pos = 2)
>private String packageID;
> 
> }
> 
> when I did debug bindy code i found that when it try to scan package for
> annotated class it goes to wrong path. 
> 
> Any suggestion what i am doing wrong?
> thanks in advance
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-tp5731324.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy

2013-04-23 Thread sandeep
I did tried that also. problem is the path is create to look up package get
wrong.
it is supose to be like
"C:\Tool\JBoss\jboss-eap-6.0\standalone\tmp\vfs\deploymente15f1c1683b39c76\."

but path the classLoader.getResources returns is something like
"C:\Tool\JBoss\jboss-eap-6.0\bin\content which don't exist.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731357.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy

2013-04-23 Thread Claus Ibsen
Hi

Sounds like you need to use the jboss class resolver
http://camel.apache.org/camel-jboss.html

This may be needed to let bindy discover the model classes.

On Tue, Apr 23, 2013 at 1:44 PM, sandeep  wrote:
> I did tried that also. problem is the path is create to look up package get
> wrong.
> it is supose to be like
> "C:\Tool\JBoss\jboss-eap-6.0\standalone\tmp\vfs\deploymente15f1c1683b39c76\."
>
> but path the classLoader.getResources returns is something like
> "C:\Tool\JBoss\jboss-eap-6.0\bin\content which don't exist.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731357.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy

2013-04-23 Thread sandeep
I got some sample but all in xml spring context.
But I am working in DSL no xml. Please let me know how to do that.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731364.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy

2013-04-23 Thread sandeep
sorry for reposting but previous post not getting accepted by mailing list



Hi Claus Ibsen, 

classloder is decided by BindyCsvDataFormat class 

public Object unmarshal(Exchange exchange, InputStream inputStream) throws
Exception { 
BindyCsvFactory factory =
(BindyCsvFactory)getFactory(exchange.getContext().getPackageScanClassResolver());
 

can you let me know how can I use camel-jboss here.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731365.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy

2013-04-23 Thread sandeep
Hi Claus Ibsen,

classloder is decided by BindyCsvDataFormat class

public Object unmarshal(Exchange exchange, InputStream inputStream) throws
Exception {
BindyCsvFactory factory =
(BindyCsvFactory)getFactory(*exchange.getContext().getPackageScanClassResolver()*);

can you let me know how can I use camel-jboss here.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731361.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy

2013-04-24 Thread sandeep
Hi,

I tried something like 
camelContext.setPackageScanClassResolver(classResolver);

and no Bindy get JBossPackageScanClassResolver. but still issue is same it
is not able to fine my annotated classes. :(



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-tp5731324p5731403.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy - CsvRecord( separator = "|" )

2010-06-08 Thread Christian Müller
Hello D.,

the short answer is, use the annotation '@CsvRecord(separator = "\\|")'.
Camel-Bindy internally use java.util.String.split(String regexp, int limit)
which means, that this separator is interpreted as a regular expression.
I updated the wiki page to reflect this:
https://cwiki.apache.org/confluence/display/CAMEL/Bindy

Cheers,
Christian

On Tue, Jun 8, 2010 at 8:21 PM, DSailor  wrote:

>
> Our project is considering using Camel and most our feeds are currently
> pipe
> separated files.
> While testing Camel-bindy I managed to use different separators,
> nevertheless, when using the Unix pipe separator, Bindy comes with an
> exception and is unable to parse the record.
> Is anyone aware of such limitation ? Even though I am quite keen on using
> Camel, this would quite a serious limitation on our context.
> --
> View this message in context:
> http://old.nabble.com/Bindy---CsvRecord%28-separator-%3D-%22%7C%22-%29-tp28821374p28821374.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


Re: Bindy - CsvRecord( separator = "|" )

2010-06-09 Thread DSailor

It works perfectly - Thanks!


DSailor wrote:
> 
> Our project is considering using Camel and most our feeds are currently
> pipe separated files.
> While testing Camel-bindy I managed to use different separators,
> nevertheless, when using the Unix pipe separator, Bindy comes with an
> exception and is unable to parse the record.
> Is anyone aware of such limitation ? Even though I am quite keen on using
> Camel, this would quite a serious limitation on our context.
> 

-- 
View this message in context: 
http://old.nabble.com/Bindy---CsvRecord%28-separator-%3D-%22%7C%22-%29-tp28821374p28830103.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Bindy plus Unicode

2020-01-24 Thread Alex Dettinger
Hi Michael,

I was just looking at this component for another purpose and it looks
to me that fixed length tokenzation occurs here:

https://github.com/apache/camel/blob/master/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java#L212..L216
  So, It counts in java chars and not code points. You can maybe experiment
injecting a custom BindyFixedLengthFactory, via
dataFormat.setModelFactory(..).

  Would you feel that an extension point to customize count/selection of
chars/codepoint/grapheme would be valuable to the community, feel free to
raise a JIRA ticket.

Alex


On Fri, Jan 24, 2020 at 9:52 AM Michael Greulich 
wrote:

> Hi,
>
> I’m having problems with the bindy component and wonder if there is
> something I missed. Maybe one can help me addressing it. I cannot believe,
> that I’m the first to hit this problem.
>
> I need to port an EAI application built using bindy, that reads a fixed
> type file(*) converts it and sends the data somewhere else. Currently this
> file is in Latin 1 encoding, but we need to take it to Unicode –
> effectively UTF-8. We have an ugly, but effectively unavoidable legacy
> application that creates the file.
>
> Unicode is a bit tricky, when it comes to counting the length of a string
> specially since Java uses internally UTF-16, which means depending on the
> codepoint 1 – 2 (Java-)chars. Bindy seems to use internally for selection
> substring and counts chars like Java does. This means the length of a
> string is the count of the chars, i.e. UTF-16 surrogates, but not
> codepoints, which is the common denominator (e.g. see definition of string
> length in XMLSchema). And when one takes combing chars into account (one
> “base char” plus 0 – n combining chars are perceived as one “char” by
> users) it becomes even more of a problem.
>
> Is there a possibility to tell bindy how it counts an and selects the
> tokens based on char counts in a given line? Any suggestions? Is the are
> related bug or change to come that addresses this problem?
>
> -- Mik
>
> (*) This means, that on certain positions there start certain data
> (columns if you will).
>
>


Re: Bindy and FixedLength

2012-01-03 Thread Claus Ibsen
Hi

Why dont you try it for yourself? I would assume it would be doable
with the outline you sketched.


On Wed, Jan 4, 2012 at 6:15 AM, Fitzcaraldo
 wrote:
> I'm trying to model a COBOL copybook message using Bindy.  The basic
> structure is a fixed length header followed by multiple fixed length bodies
> - all with no separators.
>
> Can this be modeled for marshaling purposes using the following annotations:
>
>
> @FixedLengthRecord(length=60, paddingChar=' ')
> public class TestHeader {
>
>   @DataField(pos = 1, length = 4)
>    private String RECORD_ID;
>
>    etc
>
>   @OneToMany
>   private List body;
>
> }
>
>
> @FixedLengthRecord(length=40, paddingChar=' ')
> public class TestBody {
>
>   @DataField(pos = 1, length = 16)
>   private String TYPE;
>
>   etc
>
> }
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-and-FixedLength-tp5118749p5118749.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Bindy and FixedLength

2012-01-04 Thread Fitzcaraldo
OK.

So I first tried without the @OneToMany section for the lineItems and
successfully produced a TestHeader Object (using a shorter input stream)

When I put the OneToMany with a full length input stream I get the following
exception:

Size of the record: 756 is not equal to the value provided in the model: 126

(126 bytes of header + 10x 63 bytes of body = 756)

I was hoping it might produce as many TestBody objects as required.

Is OneToMany supported with FixedLengthRecord?

Using Camel 2.9.0-RC1

Here's the TestHeader class

@XmlRootElement //JAXB annotation
@XmlAccessorType(XmlAccessType.FIELD)
@FixedLengthRecord(length=126, paddingChar=' ')
public class TestHeader {

@DataField(pos = 1, length = 4)
private String RECORD_ID;

@DataField(pos = 5, length = 1)
private String ACTION;

@DataField(pos = 6, length = 13)
private String TRAN_NO;

@DataField(pos = 19, length = 3)
private String DATA_TYPE;
 
@DataField(pos = 22, length = 6)
private String TRAN_DEST;

@DataField(pos = 28, length = 9)
private String TRAN_SEQ_NO;

@DataField(pos = 37, length = 8)
private String RECORD_DATE;

@DataField(pos = 45, length = 5)
private String RECORD_TIME;

@DataField(pos = 50, length = 2)
private String COMP_CODE;

@DataField(pos = 52, length = 30)
private String CUST_NO;

@DataField(pos = 82, length = 5)
private String NO_LINE_ITEMS;

@DataField(pos = 87, length = 15)
private String ORD_NO;

@DataField(pos = 102, length = 2)
private String ORD_TYPE;

@DataField(pos = 104, length = 7)
private String ASSIGNMENT_NO;

@DataField(pos = 111, length = 8)
private String CUST_ORD_DATE;

@DataField(pos = 119, length = 4)
private String SOURCE_SYS;

@DataField(pos = 123, length = 2)
private String TPC_TYPE_CODE;

@OneToMany
private List lineItems;

}

and TestBody class

@FixedLengthRecord(length=63, paddingChar=' ')
public class TestBody {

@DataField(pos = 1, length = 4)
private String RECORD_ID;

@DataField(pos = 5, length = 1)
private String ACTION;

@DataField(pos = 6, length = 8)
private String RECORD_DATE;

@DataField(pos = 14, length = 5)
private String RECORD_TIME;

@DataField(pos = 19, length = 6)
private String ORD_LINE_NO;

@DataField(pos = 25, length = 9)
private String ORD_QTY;

@DataField(pos = 34, length = 20)
private String SKU;

@DataField(pos = 54, length = 4)
private String PKG_NO;

@DataField(pos = 58, length = 2)
private String UOM_ABBREV;

@DataField(pos = 60, length = 2)
private String DISTRO_TYPE;

@DataField(pos = 62, length = 2)
private String ITEM_TYPE;

}


--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-and-FixedLength-tp5118749p5121740.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy and FixedLength

2012-01-05 Thread Claus Ibsen
Hi

We plan to fix and improve camel-bindy for Camel 2.10. There is a
couple of JIRAs already.
However your use-case may not be included.

Fell free to create a JIRA with your use-case and attaching some
sample code / unit test will help verify the solution.


On Thu, Jan 5, 2012 at 5:30 AM, Fitzcaraldo
 wrote:
> OK.
>
> So I first tried without the @OneToMany section for the lineItems and
> successfully produced a TestHeader Object (using a shorter input stream)
>
> When I put the OneToMany with a full length input stream I get the following
> exception:
>
> Size of the record: 756 is not equal to the value provided in the model: 126
>
> (126 bytes of header + 10x 63 bytes of body = 756)
>
> I was hoping it might produce as many TestBody objects as required.
>
> Is OneToMany supported with FixedLengthRecord?
>
> Using Camel 2.9.0-RC1
>
> Here's the TestHeader class
>
> @XmlRootElement //JAXB annotation
> @XmlAccessorType(XmlAccessType.FIELD)
> @FixedLengthRecord(length=126, paddingChar=' ')
> public class TestHeader {
>
>        @DataField(pos = 1, length = 4)
>        private String RECORD_ID;
>
>        @DataField(pos = 5, length = 1)
>        private String ACTION;
>
>        @DataField(pos = 6, length = 13)
>        private String TRAN_NO;
>
>        @DataField(pos = 19, length = 3)
>        private String DATA_TYPE;
>
>        @DataField(pos = 22, length = 6)
>        private String TRAN_DEST;
>
>        @DataField(pos = 28, length = 9)
>        private String TRAN_SEQ_NO;
>
>        @DataField(pos = 37, length = 8)
>        private String RECORD_DATE;
>
>        @DataField(pos = 45, length = 5)
>        private String RECORD_TIME;
>
>        @DataField(pos = 50, length = 2)
>        private String COMP_CODE;
>
>        @DataField(pos = 52, length = 30)
>        private String CUST_NO;
>
>        @DataField(pos = 82, length = 5)
>        private String NO_LINE_ITEMS;
>
>        @DataField(pos = 87, length = 15)
>        private String ORD_NO;
>
>        @DataField(pos = 102, length = 2)
>        private String ORD_TYPE;
>
>        @DataField(pos = 104, length = 7)
>        private String ASSIGNMENT_NO;
>
>        @DataField(pos = 111, length = 8)
>        private String CUST_ORD_DATE;
>
>        @DataField(pos = 119, length = 4)
>        private String SOURCE_SYS;
>
>        @DataField(pos = 123, length = 2)
>        private String TPC_TYPE_CODE;
>
>        @OneToMany
>        private List lineItems;
>
> }
>
> and TestBody class
>
> @FixedLengthRecord(length=63, paddingChar=' ')
> public class TestBody {
>
>        @DataField(pos = 1, length = 4)
>    private String RECORD_ID;
>
>        @DataField(pos = 5, length = 1)
>        private String ACTION;
>
>        @DataField(pos = 6, length = 8)
>        private String RECORD_DATE;
>
>        @DataField(pos = 14, length = 5)
>        private String RECORD_TIME;
>
>        @DataField(pos = 19, length = 6)
>        private String ORD_LINE_NO;
>
>        @DataField(pos = 25, length = 9)
>        private String ORD_QTY;
>
>        @DataField(pos = 34, length = 20)
>        private String SKU;
>
>        @DataField(pos = 54, length = 4)
>        private String PKG_NO;
>
>        @DataField(pos = 58, length = 2)
>        private String UOM_ABBREV;
>
>        @DataField(pos = 60, length = 2)
>        private String DISTRO_TYPE;
>
>        @DataField(pos = 62, length = 2)
>        private String ITEM_TYPE;
>
> }
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-and-FixedLength-tp5118749p5121740.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Bindy fixed length

2013-04-17 Thread Claus Ibsen
Hi

I think you should add more detail what you are asking about.
I dont think we understand what you want

On Tue, Apr 16, 2013 at 5:04 PM, fbarbat  wrote:
> Hi,
>
> Is there anything similar to Hibernate's components in bindy? It would be
> nice if we can nest objects to model one line.
>
> Thanks.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy fixed length

2013-04-17 Thread fbarbat
Sorry, after I wrote the post I felt it wasn't clear enough too...
I wanted to ask if there was a feature to similar to Hibernate's components
(or BeanIO segments) to break the bean into a root bean and smaller nested
beans. 

For example, let's suppose I have this line:
NAME--LAST_NAME-ADDRESS---ZIP_CODE--

We could model this line as a POJO called Person, and it would be something
like this:

@FixedLengthRecord
class Person{
@DataField(pos=1, length=10)
private String name;
@DataField(pos=2, length=10)
private String lastName;
@DataField(pos=3, length=10)
private String address;
@DataField(pos=4, length=10)
private String zipCode;

//Getters and setters...
}

Now, if the amount of fields grows too much, I would like to split this
object into several nested objects. For example, now I want to have two
objects:

//Nested bean, relative to the position specified in parent bean
@FixedLengthRecord
class Address{
@DataField(pos=1, length=10)
private String address;
@DataField(pos=2, length=10)
private String zipCode;

//Getters and setters...
}

//Root bean
@FixedLengthRecord
class Person {
@DataField(pos=1, length=10)
private String name;
@DataField(pos=2, length=10)
private String lastName;
@DataField(pos=3, length=10)
private Address address;

//Getters and setters
}

I tried to find a feature like this in Bindy but I couldn't find one. As a
workaround, I switched to BeanIO for marshalling/unmarshalling this way.
Anyway, I would have liked to use annotations instead of the BeanIO XML
file.

Thanks,.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731037.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy fixed length

2013-04-17 Thread Magnus Palmér
There are examples of how to do it on the Bindy documentation page:
http://camel.apache.org/bindy.html

Look for the @Link


2013/4/17 fbarbat 

> Sorry, after I wrote the post I felt it wasn't clear enough too...
> I wanted to ask if there was a feature to similar to Hibernate's components
> (or BeanIO segments) to break the bean into a root bean and smaller nested
> beans.
>
> For example, let's suppose I have this line:
> NAME--LAST_NAME-ADDRESS---ZIP_CODE--
>
> We could model this line as a POJO called Person, and it would be something
> like this:
>
> @FixedLengthRecord
> class Person{
> @DataField(pos=1, length=10)
> private String name;
> @DataField(pos=2, length=10)
> private String lastName;
> @DataField(pos=3, length=10)
> private String address;
> @DataField(pos=4, length=10)
> private String zipCode;
>
> //Getters and setters...
> }
>
> Now, if the amount of fields grows too much, I would like to split this
> object into several nested objects. For example, now I want to have two
> objects:
>
> //Nested bean, relative to the position specified in parent bean
> @FixedLengthRecord
> class Address{
> @DataField(pos=1, length=10)
> private String address;
> @DataField(pos=2, length=10)
> private String zipCode;
>
> //Getters and setters...
> }
>
> //Root bean
> @FixedLengthRecord
> class Person {
> @DataField(pos=1, length=10)
> private String name;
> @DataField(pos=2, length=10)
> private String lastName;
> @DataField(pos=3, length=10)
> private Address address;
>
> //Getters and setters
> }
>
> I tried to find a feature like this in Bindy but I couldn't find one. As a
> workaround, I switched to BeanIO for marshalling/unmarshalling this way.
> Anyway, I would have liked to use annotations instead of the BeanIO XML
> file.
>
> Thanks,.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731037.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Bindy fixed length

2013-04-18 Thread fbarbat
I tried it but I couldn't make it work. It says @Link is for @CsvRecord.
Should it work on @FixedLengthRecord too?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy fixed length

2013-04-18 Thread Magnus Palmér
It should work, but it doesn't for me.

Seems like the BindyFixedLengthFactory does properly notice that I have
linked two fields in the middle of my record when it builds the model, but
when it does the parsing (unmarshalling) it tries to read all the fields
from the main record and not properly take into account the pos in the
record.

So with Rec1 with fields 1,2,3,Linked(4,5), 6,7 reads the field from the
input as 1,2,3,6,7,4,5
In other words, it doesn't take pos or position into consideration.

Not sure if it is a bug or if I do something wrong, I've only used Bindy
for CSV myself previously.


2013/4/18 fbarbat 

> I tried it but I couldn't make it work. It says @Link is for @CsvRecord.
> Should it work on @FixedLengthRecord too?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Bindy fixed length

2013-04-18 Thread Charles Moulliard
Hi,

Can you provide the code used so we can make a try (unit test using
camel-bindy) and fix if there is an issue please ? As I have created the
@Link long time ago, I need to refresh my brain before to tell if there is
an issue or not ;-)

Regards,


On Thu, Apr 18, 2013 at 5:34 PM, fbarbat  wrote:

> I tried it but I couldn't make it work. It says @Link is for @CsvRecord.
> Should it work on @FixedLengthRecord too?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Re: Bindy fixed length

2013-04-18 Thread Magnus Palmér
A very simple JUnit test, code and description is in the below gist:
https://gist.github.com/magnuspalmer/5418305



2013/4/19 Charles Moulliard 

> Hi,
>
> Can you provide the code used so we can make a try (unit test using
> camel-bindy) and fix if there is an issue please ? As I have created the
> @Link long time ago, I need to refresh my brain before to tell if there is
> an issue or not ;-)
>
> Regards,
>
>
> On Thu, Apr 18, 2013 at 5:34 PM, fbarbat  wrote:
>
> > I tried it but I couldn't make it work. It says @Link is for @CsvRecord.
> > Should it work on @FixedLengthRecord too?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>


Re: Bindy fixed length

2013-04-18 Thread Charles Moulliard
Thx. Will have a look.


On Fri, Apr 19, 2013 at 7:21 AM, Magnus Palmér  wrote:

> A very simple JUnit test, code and description is in the below gist:
> https://gist.github.com/magnuspalmer/5418305
>
>
>
> 2013/4/19 Charles Moulliard 
>
> > Hi,
> >
> > Can you provide the code used so we can make a try (unit test using
> > camel-bindy) and fix if there is an issue please ? As I have created the
> > @Link long time ago, I need to refresh my brain before to tell if there
> is
> > an issue or not ;-)
> >
> > Regards,
> >
> >
> > On Thu, Apr 18, 2013 at 5:34 PM, fbarbat  wrote:
> >
> > > I tried it but I couldn't make it work. It says @Link is for
> @CsvRecord.
> > > Should it work on @FixedLengthRecord too?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Re: Bindy fixed length

2013-04-27 Thread Charles Moulliard
I have tested your code and the test succeed. I will include it to the next
release of Camel
Here is what I have tested (
https://gist.github.com/cmoulliard/7c5bd8d98717480f988d)

On Fri, Apr 19, 2013 at 8:11 AM, Charles Moulliard  wrote:

> Thx. Will have a look.
>
>
> On Fri, Apr 19, 2013 at 7:21 AM, Magnus Palmér <
> magnus.palmer.w...@gmail.com> wrote:
>
>> A very simple JUnit test, code and description is in the below gist:
>> https://gist.github.com/magnuspalmer/5418305
>>
>>
>>
>> 2013/4/19 Charles Moulliard 
>>
>> > Hi,
>> >
>> > Can you provide the code used so we can make a try (unit test using
>> > camel-bindy) and fix if there is an issue please ? As I have created the
>> > @Link long time ago, I need to refresh my brain before to tell if there
>> is
>> > an issue or not ;-)
>> >
>> > Regards,
>> >
>> >
>> > On Thu, Apr 18, 2013 at 5:34 PM, fbarbat  wrote:
>> >
>> > > I tried it but I couldn't make it work. It says @Link is for
>> @CsvRecord.
>> > > Should it work on @FixedLengthRecord too?
>> > >
>> > >
>> > >
>> > > --
>> > > View this message in context:
>> > >
>> >
>> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
>> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>> > >
>> >
>> >
>> >
>> > --
>> > Charles Moulliard
>> > Apache Committer / Sr. Enterprise Architect (RedHat)
>> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>> >
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Re: Bindy fixed length

2013-04-27 Thread Babak Vahdat
Hi Charles,

This new test being committed into trunk is failing for me: 

~/dev/workspace/camel/components/camel-bindy>mvn test
-Dtest=BindySimpleFixedLengthWithLinkTest
[INFO] Scanning for projects...
[INFO] 
[INFO]

[INFO] Building Camel :: Bindy 2.12-SNAPSHOT
[INFO]

[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-bindy
---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ camel-bindy
---
[INFO] 
[INFO] >>> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
(default) @ camel-bindy >>>
[INFO] 
[INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-bindy
---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ camel-bindy
---
[INFO] 
[INFO] <<< camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
(default) @ camel-bindy <<<
[INFO] 
[INFO] --- camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
(default) @ camel-bindy ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
camel-bindy ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
camel-bindy ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources)
@ camel-bindy ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 41 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
camel-bindy ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.13:test (default-test) @ camel-bindy ---
[INFO] Surefire report directory:
/Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports

---
 T E S T S
---
Running
org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.42 sec <<<
FAILURE!
testUnmarshallMessage(org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest)
 
Time elapsed: 0.332 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<[BBB]> but was:<[CCC]>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at
org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage(BindySimpleFixedLengthWithLinkTest.java:63)


Results :

Failed tests: 
 
BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage:63->Assert.assertEquals:144->Assert.assertEquals:115
expected:<[BBB]> but was:<[CCC]>

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[INFO]

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 3.115s
[INFO] Finished at: Sat Apr 27 11:02:48 CEST 2013
[INFO] Final Memory: 13M/1011M
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on
project camel-bindy: There are test failures.
[ERROR] 
[ERROR] Please refer to
/Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports
for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Babak



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731667.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy fixed length

2013-04-27 Thread Charles Moulliard
Will have a look tomorrow to solve the bug.


On Sat, Apr 27, 2013 at 11:06 AM, Babak Vahdat
wrote:

> Hi Charles,
>
> This new test being committed into trunk is failing for me:
>
> ~/dev/workspace/camel/components/camel-bindy>mvn test
> -Dtest=BindySimpleFixedLengthWithLinkTest
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> 
> [INFO] Building Camel :: Bindy 2.12-SNAPSHOT
> [INFO]
> 
> [INFO]
> [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-bindy
> ---
> [INFO]
> [INFO] --- maven-remote-resources-plugin:1.4:process (default) @
> camel-bindy
> ---
> [INFO]
> [INFO] >>>
> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
> (default) @ camel-bindy >>>
> [INFO]
> [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-bindy
> ---
> [INFO]
> [INFO] --- maven-remote-resources-plugin:1.4:process (default) @
> camel-bindy
> ---
> [INFO]
> [INFO] <<<
> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
> (default) @ camel-bindy <<<
> [INFO]
> [INFO] ---
> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
> (default) @ camel-bindy ---
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
> camel-bindy ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 5 resources
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
> camel-bindy ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources)
> @ camel-bindy ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 41 resources
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
> camel-bindy ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] --- maven-surefire-plugin:2.13:test (default-test) @ camel-bindy ---
> [INFO] Surefire report directory:
>
> /Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports
>
> ---
>  T E S T S
> ---
> Running
>
> org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.42 sec
> <<<
> FAILURE!
>
> testUnmarshallMessage(org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest)
> Time elapsed: 0.332 sec  <<< FAILURE!
> org.junit.ComparisonFailure: expected:<[BBB]> but was:<[CCC]>
> at org.junit.Assert.assertEquals(Assert.java:115)
> at org.junit.Assert.assertEquals(Assert.java:144)
> at
>
> org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage(BindySimpleFixedLengthWithLinkTest.java:63)
>
>
> Results :
>
> Failed tests:
>
>
> BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage:63->Assert.assertEquals:144->Assert.assertEquals:115
> expected:<[BBB]> but was:<[CCC]>
>
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
>
> [INFO]
> 
> [INFO] BUILD FAILURE
> [INFO]
> 
> [INFO] Total time: 3.115s
> [INFO] Finished at: Sat Apr 27 11:02:48 CEST 2013
> [INFO] Final Memory: 13M/1011M
> [INFO]
> 
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on
> project camel-bindy: There are test failures.
> [ERROR]
> [ERROR] Please refer to
>
> /Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports
> for the individual test results.
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>
> Babak
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Re: Bindy fixed length

2013-04-28 Thread Charles Moulliard
Ticket created : https://issues.apache.org/jira/browse/CAMEL-6323


On Sat, Apr 27, 2013 at 12:49 PM, Charles Moulliard wrote:

> Will have a look tomorrow to solve the bug.
>
>
> On Sat, Apr 27, 2013 at 11:06 AM, Babak Vahdat <
> babak.vah...@swissonline.ch> wrote:
>
>> Hi Charles,
>>
>> This new test being committed into trunk is failing for me:
>>
>> ~/dev/workspace/camel/components/camel-bindy>mvn test
>> -Dtest=BindySimpleFixedLengthWithLinkTest
>> [INFO] Scanning for projects...
>> [INFO]
>> [INFO]
>> 
>> [INFO] Building Camel :: Bindy 2.12-SNAPSHOT
>> [INFO]
>> 
>> [INFO]
>> [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @
>> camel-bindy
>> ---
>> [INFO]
>> [INFO] --- maven-remote-resources-plugin:1.4:process (default) @
>> camel-bindy
>> ---
>> [INFO]
>> [INFO] >>>
>> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
>> (default) @ camel-bindy >>>
>> [INFO]
>> [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @
>> camel-bindy
>> ---
>> [INFO]
>> [INFO] --- maven-remote-resources-plugin:1.4:process (default) @
>> camel-bindy
>> ---
>> [INFO]
>> [INFO] <<<
>> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
>> (default) @ camel-bindy <<<
>> [INFO]
>> [INFO] ---
>> camel-package-maven-plugin:2.12-SNAPSHOT:generate-components-list
>> (default) @ camel-bindy ---
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @
>> camel-bindy ---
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 5 resources
>> [INFO] Copying 3 resources
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
>> camel-bindy ---
>> [INFO] Nothing to compile - all classes are up to date
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.6:testResources
>> (default-testResources)
>> @ camel-bindy ---
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 41 resources
>> [INFO] Copying 3 resources
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
>> camel-bindy ---
>> [INFO] Nothing to compile - all classes are up to date
>> [INFO]
>> [INFO] --- maven-surefire-plugin:2.13:test (default-test) @ camel-bindy
>> ---
>> [INFO] Surefire report directory:
>>
>> /Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports
>>
>> ---
>>  T E S T S
>> ---
>> Running
>>
>> org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest
>> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.42 sec
>> <<<
>> FAILURE!
>>
>> testUnmarshallMessage(org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest)
>> Time elapsed: 0.332 sec  <<< FAILURE!
>> org.junit.ComparisonFailure: expected:<[BBB]> but was:<[CCC]>
>> at org.junit.Assert.assertEquals(Assert.java:115)
>> at org.junit.Assert.assertEquals(Assert.java:144)
>> at
>>
>> org.apache.camel.dataformat.bindy.fixed.link.BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage(BindySimpleFixedLengthWithLinkTest.java:63)
>>
>>
>> Results :
>>
>> Failed tests:
>>
>>
>> BindySimpleFixedLengthWithLinkTest.testUnmarshallMessage:63->Assert.assertEquals:144->Assert.assertEquals:115
>> expected:<[BBB]> but was:<[CCC]>
>>
>> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
>>
>> [INFO]
>> 
>> [INFO] BUILD FAILURE
>> [INFO]
>> 
>> [INFO] Total time: 3.115s
>> [INFO] Finished at: Sat Apr 27 11:02:48 CEST 2013
>> [INFO] Final Memory: 13M/1011M
>> [INFO]
>> 
>> [ERROR] Failed to execute goal
>> org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on
>> project camel-bindy: There are test failures.
>> [ERROR]
>> [ERROR] Please refer to
>>
>> /Users/bvahdat/dev/workspace/camel/components/camel-bindy/target/surefire-reports
>> for the individual test results.
>> [ERROR] -> [Help 1]
>> [ERROR]
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>> -e
>> switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions,
>> please
>> read the following articles:
>> [ERROR] [Help 1]
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>>
>> Babak
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731667.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (Re

Re: Bindy fixed length

2013-04-30 Thread Charles Moulliard
Hi Magnus,

I have committed a modification to camel-bindy (
https://issues.apache.org/jira/browse/CAMEL-6323).
That works with camel-2.12-SNAPSHOT and
http://svn.apache.org/repos/asf/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fixed/link/BindySimpleFixedLengthWithLinkTest.java

Regards,

Charles


On Fri, Apr 19, 2013 at 7:21 AM, Magnus Palmér  wrote:

> A very simple JUnit test, code and description is in the below gist:
> https://gist.github.com/magnuspalmer/5418305
>
>
>
> 2013/4/19 Charles Moulliard 
>
> > Hi,
> >
> > Can you provide the code used so we can make a try (unit test using
> > camel-bindy) and fix if there is an issue please ? As I have created the
> > @Link long time ago, I need to refresh my brain before to tell if there
> is
> > an issue or not ;-)
> >
> > Regards,
> >
> >
> > On Thu, Apr 18, 2013 at 5:34 PM, fbarbat  wrote:
> >
> > > I tried it but I couldn't make it work. It says @Link is for
> @CsvRecord.
> > > Should it work on @FixedLengthRecord too?
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-tp5730980p5731093.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Re: Bindy infinite loop

2013-09-20 Thread Christian Posta
What version of camel does this affect?


On Fri, Sep 20, 2013 at 7:16 AM, fclose  wrote:

> I have a route that looks like this
>
> 
> 
> 
> 
> 
>  uri="bean:importLineHandler?method=handleImport"/>
> 
> 
>
>  class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
> 
> 
>
>
> if the route has to process a file that contains an empty line at the end
> (I suppose that if I have an empty line in the middle of the file, the
> problem will be the same) then the process restarts from the beginning of
> the file and so on ... infinite loop.
>
> The problem is only happening on Linux, I could not reproduce it on
> windows.
>
> Is it due to the token separator \n ?
> What could be done to put safe guards and avoid that something like this
> happen even if have empty lines in my file ?
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-infinite-loop-tp5739879.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: Bindy infinite loop

2013-09-24 Thread fclose
I had the problem with 2.10.3 and did not test with newer version.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-infinite-loop-tp5739879p5740122.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy unmarshalling issues

2013-11-28 Thread cgsk
Hi There,

I am using Bindy for marshalling/unmarshalling to & from a csv file. One of
the data value has carriage return. I am using separator = "," ,quote="\"".
While marshalling to csv file, it works properly. So if i open the csv file
in Excel, the data shows in with carriage return. But unmarshall to read
back to my object it considers the fields after the field with carriage
return as next records and throws error.

Any help to fix this.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Re-Bindy-unmarshalling-issues-tp5744012.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy unmarshalling issues

2013-11-28 Thread Claus Ibsen
I dont think so as a CR would mean the next line and thus a new CSV line.
You can maybe replace the CR before calling bindy etc.


On Thu, Nov 28, 2013 at 12:50 PM, cgsk  wrote:
> Hi There,
>
> I am using Bindy for marshalling/unmarshalling to & from a csv file. One of
> the data value has carriage return. I am using separator = "," ,quote="\"".
> While marshalling to csv file, it works properly. So if i open the csv file
> in Excel, the data shows in with carriage return. But unmarshall to read
> back to my object it considers the fields after the field with carriage
> return as next records and throws error.
>
> Any help to fix this.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Re-Bindy-unmarshalling-issues-tp5744012.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy unmarshalling issues

2013-11-28 Thread cgsk
Thanks for the reply.

CR is within the double quotes, so not considered as field value instead of
new line and the csv file opens correctly in Excel.  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Re-Bindy-unmarshalling-issues-tp5744012p5744015.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy unmarshalling issues

2013-11-28 Thread Claus Ibsen
Hi

What version of Camel do you use? We had some bugs over the time that
has been fixed in bindy in recent releases etc. So try upgrading Camel
if possible.


On Thu, Nov 28, 2013 at 1:46 PM, cgsk  wrote:
> Thanks for the reply.
>
> CR is within the double quotes, so not considered as field value instead of
> new line and the csv file opens correctly in Excel.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Re-Bindy-unmarshalling-issues-tp5744012p5744015.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy Custom Timezone

2013-12-10 Thread Daneel Yaitskov

Since this time the master branch has got @DataField timezone attribute.
It takes Java Time Zone Id.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-Custom-Timezone-tp5744412p5744571.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy CSV not Marshaling

2010-05-30 Thread Claus Ibsen
On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker  wrote:
> Are there known issues with Bindy and marshaling POJOs to CSV?  I followed
> the example and my objects aren't getting past the marshal(...) step with
> data.  I'm getting a zero-length byte[] in the exchange after the
> marshal(...) step.  What am I missing?
>

Hi

You may have to add more details. What Camel version. What does your
POJO looks like with the annotations.
Can you see an exception in the logs etc.

At first I suggest to take a look at the unit tests of camel-bindy or
chapter 3 in the Camel in Action book which contains a Bindy example.
The source code for the book is free so you can actually find the
source code for the example there.


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


Re: Bindy CSV not Marshaling

2010-05-30 Thread Nick Heudecker
Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
First, BindyAbstractFactory#generateKey() creates an invalid number if you
don't define a @Section annotation.  You'll get a key like 'null000',
resulting in a NumberFormatException.

Next, Bindy doesn't support Booleans or booleans.



On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen  wrote:

> On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker 
> wrote:
> > Are there known issues with Bindy and marshaling POJOs to CSV?  I
> followed
> > the example and my objects aren't getting past the marshal(...) step with
> > data.  I'm getting a zero-length byte[] in the exchange after the
> > marshal(...) step.  What am I missing?
> >
>
> Hi
>
> You may have to add more details. What Camel version. What does your
> POJO looks like with the annotations.
> Can you see an exception in the logs etc.
>
> At first I suggest to take a look at the unit tests of camel-bindy or
> chapter 3 in the Camel in Action book which contains a Bindy example.
> The source code for the book is free so you can actually find the
> source code for the example there.
>
>
> --
> 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
>


Re: Bindy CSV not Marshaling

2010-05-30 Thread Claus Ibsen
On Mon, May 31, 2010 at 7:50 AM, Nick Heudecker  wrote:
> Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
> First, BindyAbstractFactory#generateKey() creates an invalid number if you
> don't define a @Section annotation.  You'll get a key like 'null000',
> resulting in a NumberFormatException.
>
> Next, Bindy doesn't support Booleans or booleans.
>

Can you create tickets in JIRA about the bugs and if possible a little
piece of sample to go along?
http://issues.apache.org/activemq/browse/CAMEL

>
>
> On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen  wrote:
>
>> On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker 
>> wrote:
>> > Are there known issues with Bindy and marshaling POJOs to CSV?  I
>> followed
>> > the example and my objects aren't getting past the marshal(...) step with
>> > data.  I'm getting a zero-length byte[] in the exchange after the
>> > marshal(...) step.  What am I missing?
>> >
>>
>> Hi
>>
>> You may have to add more details. What Camel version. What does your
>> POJO looks like with the annotations.
>> Can you see an exception in the logs etc.
>>
>> At first I suggest to take a look at the unit tests of camel-bindy or
>> chapter 3 in the Camel in Action book which contains a Bindy example.
>> The source code for the book is free so you can actually find the
>> source code for the example there.
>>
>>
>> --
>> 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
>>
>



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


Re: Bindy CSV not Marshaling

2010-05-31 Thread Claus Ibsen
On Mon, May 31, 2010 at 7:55 AM, Claus Ibsen  wrote:
> On Mon, May 31, 2010 at 7:50 AM, Nick Heudecker  wrote:
>> Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
>> First, BindyAbstractFactory#generateKey() creates an invalid number if you
>> don't define a @Section annotation.  You'll get a key like 'null000',
>> resulting in a NumberFormatException.
>>
>> Next, Bindy doesn't support Booleans or booleans.
>>

How do you want to map booleans? I have never seen any CSV file with
"true" or "false" as values.
You most likely need to define a custom mapping scheme. Such as "Y" =
true, "N" = false etc.
And so you can use String type and add a isXXX boolean method yourself
in the bean.

Having a mapping for boolean in Bindy is of course nice but I think it
requires additional mapping definition to set the rules.


>
> Can you create tickets in JIRA about the bugs and if possible a little
> piece of sample to go along?
> http://issues.apache.org/activemq/browse/CAMEL
>

I created the ticket
https://issues.apache.org/activemq/browse/CAMEL-2773

>>
>>
>> On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen  wrote:
>>
>>> On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker 
>>> wrote:
>>> > Are there known issues with Bindy and marshaling POJOs to CSV?  I
>>> followed
>>> > the example and my objects aren't getting past the marshal(...) step with
>>> > data.  I'm getting a zero-length byte[] in the exchange after the
>>> > marshal(...) step.  What am I missing?
>>> >
>>>
>>> Hi
>>>
>>> You may have to add more details. What Camel version. What does your
>>> POJO looks like with the annotations.
>>> Can you see an exception in the logs etc.
>>>
>>> At first I suggest to take a look at the unit tests of camel-bindy or
>>> chapter 3 in the Camel in Action book which contains a Bindy example.
>>> The source code for the book is free so you can actually find the
>>> source code for the example there.
>>>
>>>
>>> --
>>> 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
>>>
>>
>
>
>
> --
> 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
>



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


Re: Bindy CSV not Marshaling

2010-05-31 Thread Nick Heudecker
> How do you want to map booleans? I have never seen any CSV file with
> "true" or "false" as values.
> You most likely need to define a custom mapping scheme. Such as "Y" =
> true, "N" = false etc.
> And so you can use String type and add a isXXX boolean method yourself
> in the bean.
>
> Having a mapping for boolean in Bindy is of course nice but I think it
> requires additional mapping definition to set the rules.
>
>
Does this mapping capability exist and I missed it?


>
> >
> > Can you create tickets in JIRA about the bugs and if possible a little
> > piece of sample to go along?
> > http://issues.apache.org/activemq/browse/CAMEL
> >
>
> I created the ticket
> https://issues.apache.org/activemq/browse/CAMEL-2773
>
>
Thanks.


Re: Bindy CSV not Marshaling

2010-06-01 Thread Claus Ibsen
On Tue, Jun 1, 2010 at 8:42 AM, Nick Heudecker  wrote:
>> How do you want to map booleans? I have never seen any CSV file with
>> "true" or "false" as values.
>> You most likely need to define a custom mapping scheme. Such as "Y" =
>> true, "N" = false etc.
>> And so you can use String type and add a isXXX boolean method yourself
>> in the bean.
>>
>> Having a mapping for boolean in Bindy is of course nice but I think it
>> requires additional mapping definition to set the rules.
>>
>>
> Does this mapping capability exist and I missed it?
>

No I dont think so.

>
>>
>> >
>> > Can you create tickets in JIRA about the bugs and if possible a little
>> > piece of sample to go along?
>> > http://issues.apache.org/activemq/browse/CAMEL
>> >
>>
>> I created the ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2773
>>
>>
> Thanks.
>



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


Re: Bindy CSV not Marshaling

2010-06-01 Thread Charles Moulliard
As mentioned by claus, this mapping does not exist.

This could be an excellent idea to add enumeration in the model and
use it to validate the content parsed. Enumeration could be used not
only for this simple case where we would like to check if we get Y, N
or true, false but also to check list value and transform it.

ex : C = cancel for order process,  A = accept, ...

I have assigned the ticket to me and will work on that when I will add
fixed length format to Bindy and solve some bugs discovered.

Kind regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel/ServiceMix Committer

***
- Blog : http://cmoulliard.blogspot.com
- Twitter : http://twitter.com/cmoulliard
- Linkedlin : http://www.linkedin.com/in/charlesmoulliard



On Tue, Jun 1, 2010 at 9:00 AM, Claus Ibsen  wrote:
> On Tue, Jun 1, 2010 at 8:42 AM, Nick Heudecker  wrote:
>>> How do you want to map booleans? I have never seen any CSV file with
>>> "true" or "false" as values.
>>> You most likely need to define a custom mapping scheme. Such as "Y" =
>>> true, "N" = false etc.
>>> And so you can use String type and add a isXXX boolean method yourself
>>> in the bean.
>>>
>>> Having a mapping for boolean in Bindy is of course nice but I think it
>>> requires additional mapping definition to set the rules.
>>>
>>>
>> Does this mapping capability exist and I missed it?
>>
>
> No I dont think so.
>
>>
>>>
>>> >
>>> > Can you create tickets in JIRA about the bugs and if possible a little
>>> > piece of sample to go along?
>>> > http://issues.apache.org/activemq/browse/CAMEL
>>> >
>>>
>>> I created the ticket
>>> https://issues.apache.org/activemq/browse/CAMEL-2773
>>>
>>>
>> Thanks.
>>
>
>
>
> --
> 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
>


Re: Bindy CSV not Marshaling

2010-06-11 Thread cmoulliard

I have committed a fix on camel

You can test it using the camel-2.4-SNASPHOT

and you will have now an error :

@Section and/or @KeyValuePairDataField have not been defined !

KR,

Charles


Nick Heudecker wrote:
> 
> Thanks for the response.  There appear to be two bugs with Bindy 2.3.0.
> First, BindyAbstractFactory#generateKey() creates an invalid number if you
> don't define a @Section annotation.  You'll get a key like 'null000',
> resulting in a NumberFormatException.
> 
> Next, Bindy doesn't support Booleans or booleans.
> 
> 
> 
> On Sun, May 30, 2010 at 1:57 AM, Claus Ibsen 
> wrote:
> 
>> On Sun, May 30, 2010 at 5:30 AM, Nick Heudecker 
>> wrote:
>> > Are there known issues with Bindy and marshaling POJOs to CSV?  I
>> followed
>> > the example and my objects aren't getting past the marshal(...) step
>> with
>> > data.  I'm getting a zero-length byte[] in the exchange after the
>> > marshal(...) step.  What am I missing?
>> >
>>
>> Hi
>>
>> You may have to add more details. What Camel version. What does your
>> POJO looks like with the annotations.
>> Can you see an exception in the logs etc.
>>
>> At first I suggest to take a look at the unit tests of camel-bindy or
>> chapter 3 in the Camel in Action book which contains a Bindy example.
>> The source code for the book is free so you can actually find the
>> source code for the example there.
>>
>>
>> --
>> 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
>>
> 
> 


-
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: 
http://old.nabble.com/Bindy-CSV-not-Marshaling-tp28719942p28856371.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Bindy Dateformat Parsing exception

2010-11-23 Thread Richard Kettelerij

@manoj.sahu, you need to subscribe to the mailing list in order to post
messages. Signing up to Nabble isn't sufficient, your message is currently
only visible to Nabble users.

Concerning the hard coded locale, i've created a bug report for it:
https://issues.apache.org/activemq/browse/CAMEL-3356.
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-Dateformat-Parsing-exception-tp3276981p3277486.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy Dateformat Parsing exception

2010-11-23 Thread hadrian

@richard, thanks for creating the jira. I just committed a fix. 
@manoj, could you please give it a try and see if this works for you?
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-Dateformat-Parsing-exception-tp3276981p3277896.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Bindy and composed fields

2012-11-14 Thread Ramkumar.Iyer
I am not a camel expert but one thing you could try is to "route" the first two 
fields to one route and  the third field (which can contain multiple fields) 
into another  route as a string and then route the string again to another 
route which is merged with the first route.

-Original Message-
From: jalogar [mailto:jesu.alo...@gmail.com]
Sent: Wednesday, November 14, 2012 8:19 PM
To: users@camel.apache.org
Subject: Bindy and composed fields

Hi there,

I'm trying to unmarshal a csv that have composed fields. For instance, in
the following example

"order1","f...@email.com","(test1;45),(test2;89)"

The third attribute would represent a list of two items (but the size of the
list is not constant), each item having a name and a price. The @Link
annotation only works in one-to-one annotation, so it is not an option. The
@OneToMany annotation in csv only works for writting so is neither an
option.

The csv is written by non technical stuff, so a complex format is not an
option either.

Is it possible to manage this requirement?

Many thanks in advance
Jesús



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-and-composed-fields-tp5722732.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.


Re: Bindy - sub-byte support?

2011-05-27 Thread Claus Ibsen
On Friday, May 27, 2011, Klug, Johannes  wrote:
> Dear list,
>
>
>
> Looking at Bindy [1],  I wondered whether it had sub-byte support. Let
> me explain:
>
> Imagine two 4-bit Integers, packed as one byte. Could you use Bindy to
> extract both of them?
>

No that is not possible. We may add support for custom types and Type
marshallers in the future. As usual contributions is welcome.

You can though add two getters that get the bits from that byte in
your model class
>
>
> Cheers,
>
> Johannes
>
>
>
> [1] http://camel.apache.org/bindy.html
>
>
>
> Think green - keep it on the screen.
>
> This e-mail and any attachment is for authorised use by the intended 
> recipient(s) only. It may contain proprietary material, confidential 
> information and/or be subject to legal privilege. It should not be copied, 
> disclosed to, retained or used by, any other party. If you are not an 
> intended recipient then please promptly delete this e-mail and any attachment 
> and all copies and inform the sender. Thank you.
>
>

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


RE: Bindy - sub-byte support?

2011-05-27 Thread Klug, Johannes
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> On Friday, May 27, 2011, Klug, Johannes  wrote:
> > Looking at Bindy [1],  I wondered whether it had sub-byte support.
> > Let me explain:
> >
> > Imagine two 4-bit Integers, packed as one byte. Could you use Bindy
> > to extract both of them?
> >
> 
> No that is not possible. We may add support for custom types and Type
> marshallers in the future. As usual contributions is welcome.
> 
> You can though add two getters that get the bits from that byte in
> your model class

Thanks for the answer. Our use cases are not all as trivial as that, though. 
Some pieces of the incoming data are just one bit long (flags), others span 
multiple bytes. For our project, we've written a completely flexible engine for 
unmarshalling data like that, including signed/unsigned 
little-endian/big-endian int support, and floating point numbers.

I'm not sure how much effort it would be to integrate that into Camel - and it 
seems like ours is a fairly exotic problem which the rest of the world doesn't 
really care about. I'll check the Bindy code when I've got some time to get a 
feel for the component.

Cheers,
Johannes

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.




Re: Bindy column name annotation?

2019-08-27 Thread George Daswani
Are you using it to parse CSV files?  or produce CSV files?

I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems with 
the first being it doesn't properly support RFC-4180 CSV files, and the second 
being it uses reflection to set properties..

On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
mailto:mikael.grevs...@gmail.com>> wrote:
Good morning.

Using Bindy dataformat, in the documentation nothing states how to set column 
name but some example has the name attribute given as if possible to set the 
name of the column header to anything other than the field name. This 
appartently doesn’t work so question is, is it possible?

when marshalling to csv file

Thx

M


Re: Bindy column name annotation?

2019-08-27 Thread Mikael Andersson Wigander
Used for creating CSV files with a hierarchy of objects using @Link annotation

I find it odd NOT having the option to name the column using annotation since 
you have control over other attributes…

M

> On 27 Aug 2019, at 18:52, George Daswani  wrote:
> 
> Are you using it to parse CSV files?  or produce CSV files?
> 
> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems 
> with the first being it doesn't properly support RFC-4180 CSV files, and the 
> second being it uses reflection to set properties..
> 
> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
> mailto:mikael.grevs...@gmail.com>> wrote:
> Good morning.
> 
> Using Bindy dataformat, in the documentation nothing states how to set column 
> name but some example has the name attribute given as if possible to set the 
> name of the column header to anything other than the field name. This 
> appartently doesn’t work so question is, is it possible?
> 
> when marshalling to csv file
> 
> Thx
> 
> M



Re: Bindy column name annotation?

2019-08-30 Thread Claus Ibsen
Hi

Can you maybe provide a small example or sample code what you are looking for?

On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
 wrote:
>
> Used for creating CSV files with a hierarchy of objects using @Link annotation
>
> I find it odd NOT having the option to name the column using annotation since 
> you have control over other attributes…
>
> M
>
> > On 27 Aug 2019, at 18:52, George Daswani  wrote:
> >
> > Are you using it to parse CSV files?  or produce CSV files?
> >
> > I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems 
> > with the first being it doesn't properly support RFC-4180 CSV files, and 
> > the second being it uses reflection to set properties..
> >
> > On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
> > mailto:mikael.grevs...@gmail.com>> wrote:
> > Good morning.
> >
> > Using Bindy dataformat, in the documentation nothing states how to set 
> > column name but some example has the name attribute given as if possible to 
> > set the name of the column header to anything other than the field name. 
> > This appartently doesn’t work so question is, is it possible?
> >
> > when marshalling to csv file
> >
> > Thx
> >
> > M
>


-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Bindy column name annotation?

2019-08-30 Thread Mikael Andersson Wigander
Sure, this is from camel web


@CsvRecord(separator = ",")
public class Order {

@DataField(pos = 1)
private int orderNr;

@DataField(pos = 5)
private String isinCode;

@DataField(name = "Name", pos = 6)
private String instrumentName;

@DataField(pos = 7, precision = 2)
private BigDecimal amount;

@DataField(pos = 8)
private String currency;

// pattern used during parsing or when the date is created
@DataField(pos = 9, pattern = "dd-MM-")
private Date orderDate;
}




> On 30 Aug 2019, at 13:45, Claus Ibsen  wrote:
> 
> Hi
> 
> Can you maybe provide a small example or sample code what you are looking for?
> 
> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
>  wrote:
>> 
>> Used for creating CSV files with a hierarchy of objects using @Link 
>> annotation
>> 
>> I find it odd NOT having the option to name the column using annotation 
>> since you have control over other attributes…
>> 
>> M
>> 
>>> On 27 Aug 2019, at 18:52, George Daswani  wrote:
>>> 
>>> Are you using it to parse CSV files?  or produce CSV files?
>>> 
>>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems 
>>> with the first being it doesn't properly support RFC-4180 CSV files, and 
>>> the second being it uses reflection to set properties..
>>> 
>>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
>>> mailto:mikael.grevs...@gmail.com>> wrote:
>>> Good morning.
>>> 
>>> Using Bindy dataformat, in the documentation nothing states how to set 
>>> column name but some example has the name attribute given as if possible to 
>>> set the name of the column header to anything other than the field name. 
>>> This appartently doesn’t work so question is, is it possible?
>>> 
>>> when marshalling to csv file
>>> 
>>> Thx
>>> 
>>> M
>> 
> 
> 
> -- 
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



Re: Bindy column name annotation?

2019-08-30 Thread Claus Ibsen
So are you saying you are looking for a new attribure on the
annotation where you can set the column header name?

@DataField(headerName="myName" ...)
private String foo;


On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
 wrote:
>
> Sure, this is from camel web
>
>
> @CsvRecord(separator = ",")
> public class Order {
>
> @DataField(pos = 1)
> private int orderNr;
>
> @DataField(pos = 5)
> private String isinCode;
>
> @DataField(name = "Name", pos = 6)
> private String instrumentName;
>
> @DataField(pos = 7, precision = 2)
> private BigDecimal amount;
>
> @DataField(pos = 8)
> private String currency;
>
> // pattern used during parsing or when the date is created
> @DataField(pos = 9, pattern = "dd-MM-")
> private Date orderDate;
> }
>
>
>
>
> > On 30 Aug 2019, at 13:45, Claus Ibsen  wrote:
> >
> > Hi
> >
> > Can you maybe provide a small example or sample code what you are looking 
> > for?
> >
> > On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
> >  wrote:
> >>
> >> Used for creating CSV files with a hierarchy of objects using @Link 
> >> annotation
> >>
> >> I find it odd NOT having the option to name the column using annotation 
> >> since you have control over other attributes…
> >>
> >> M
> >>
> >>> On 27 Aug 2019, at 18:52, George Daswani  
> >>> wrote:
> >>>
> >>> Are you using it to parse CSV files?  or produce CSV files?
> >>>
> >>> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems 
> >>> with the first being it doesn't properly support RFC-4180 CSV files, and 
> >>> the second being it uses reflection to set properties..
> >>>
> >>> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
> >>> mailto:mikael.grevs...@gmail.com>> wrote:
> >>> Good morning.
> >>>
> >>> Using Bindy dataformat, in the documentation nothing states how to set 
> >>> column name but some example has the name attribute given as if possible 
> >>> to set the name of the column header to anything other than the field 
> >>> name. This appartently doesn’t work so question is, is it possible?
> >>>
> >>> when marshalling to csv file
> >>>
> >>> Thx
> >>>
> >>> M
> >>
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Bindy column name annotation?

2019-08-31 Thread Mikael Grevsten
Yes that is correct. 
I was under the impression it was there but I might confuse myself from 
jsonproperty in Jackson. 

However it would be a huge benefit if added. 

// Mikael Andersson Wigander


> 31 aug. 2019 kl. 08:34 skrev Claus Ibsen :
> 
> So are you saying you are looking for a new attribure on the
> annotation where you can set the column header name?
> 
> @DataField(headerName="myName" ...)
> private String foo;
> 
> 
> On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
>  wrote:
>> 
>> Sure, this is from camel web
>> 
>> 
>> @CsvRecord(separator = ",")
>> public class Order {
>> 
>>@DataField(pos = 1)
>>private int orderNr;
>> 
>>@DataField(pos = 5)
>>private String isinCode;
>> 
>>@DataField(name = "Name", pos = 6)
>>private String instrumentName;
>> 
>>@DataField(pos = 7, precision = 2)
>>private BigDecimal amount;
>> 
>>@DataField(pos = 8)
>>private String currency;
>> 
>>// pattern used during parsing or when the date is created
>>@DataField(pos = 9, pattern = "dd-MM-")
>>private Date orderDate;
>> }
>> 
>> 
>> 
>> 
>>> On 30 Aug 2019, at 13:45, Claus Ibsen  wrote:
>>> 
>>> Hi
>>> 
>>> Can you maybe provide a small example or sample code what you are looking 
>>> for?
>>> 
>>> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
>>>  wrote:
 
 Used for creating CSV files with a hierarchy of objects using @Link 
 annotation
 
 I find it odd NOT having the option to name the column using annotation 
 since you have control over other attributes…
 
 M
 
> On 27 Aug 2019, at 18:52, George Daswani  
> wrote:
> 
> Are you using it to parse CSV files?  or produce CSV files?
> 
> I suggest you use Camel-CSV instead.   BIndy CSV has a couple of problems 
> with the first being it doesn't properly support RFC-4180 CSV files, and 
> the second being it uses reflection to set properties..
> 
> On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander 
> mailto:mikael.grevs...@gmail.com>> wrote:
> Good morning.
> 
> Using Bindy dataformat, in the documentation nothing states how to set 
> column name but some example has the name attribute given as if possible 
> to set the name of the column header to anything other than the field 
> name. This appartently doesn’t work so question is, is it possible?
> 
> when marshalling to csv file
> 
> Thx
> 
> M
 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>> 
> 
> 
> -- 
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Bindy column name annotation?

2019-08-31 Thread Claus Ibsen
You are welcome to create a JIRA ticket and if possible work on coding this
feature

On Sat, 31 Aug 2019 at 14.09, Mikael Grevsten 
wrote:

> Yes that is correct.
> I was under the impression it was there but I might confuse myself from
> jsonproperty in Jackson.
>
> However it would be a huge benefit if added.
>
> // Mikael Andersson Wigander
>
>
> > 31 aug. 2019 kl. 08:34 skrev Claus Ibsen :
> >
> > So are you saying you are looking for a new attribure on the
> > annotation where you can set the column header name?
> >
> > @DataField(headerName="myName" ...)
> > private String foo;
> >
> >
> > On Fri, Aug 30, 2019 at 1:47 PM Mikael Andersson Wigander
> >  wrote:
> >>
> >> Sure, this is from camel web
> >>
> >>
> >> @CsvRecord(separator = ",")
> >> public class Order {
> >>
> >>@DataField(pos = 1)
> >>private int orderNr;
> >>
> >>@DataField(pos = 5)
> >>private String isinCode;
> >>
> >>@DataField(name = "Name", pos = 6)
> >>private String instrumentName;
> >>
> >>@DataField(pos = 7, precision = 2)
> >>private BigDecimal amount;
> >>
> >>@DataField(pos = 8)
> >>private String currency;
> >>
> >>// pattern used during parsing or when the date is created
> >>@DataField(pos = 9, pattern = "dd-MM-")
> >>private Date orderDate;
> >> }
> >>
> >>
> >>
> >>
> >>> On 30 Aug 2019, at 13:45, Claus Ibsen  wrote:
> >>>
> >>> Hi
> >>>
> >>> Can you maybe provide a small example or sample code what you are
> looking for?
> >>>
> >>> On Wed, Aug 28, 2019 at 7:50 AM Mikael Andersson Wigander
> >>>  wrote:
> 
>  Used for creating CSV files with a hierarchy of objects using @Link
> annotation
> 
>  I find it odd NOT having the option to name the column using
> annotation since you have control over other attributes…
> 
>  M
> 
> > On 27 Aug 2019, at 18:52, George Daswani 
> wrote:
> >
> > Are you using it to parse CSV files?  or produce CSV files?
> >
> > I suggest you use Camel-CSV instead.   BIndy CSV has a couple of
> problems with the first being it doesn't properly support RFC-4180 CSV
> files, and the second being it uses reflection to set properties..
> >
> > On Tue, Aug 27, 2019 at 12:17 AM Mikael Andersson Wigander <
> mikael.grevs...@gmail.com> wrote:
> > Good morning.
> >
> > Using Bindy dataformat, in the documentation nothing states how to
> set column name but some example has the name attribute given as if
> possible to set the name of the column header to anything other than the
> field name. This appartently doesn’t work so question is, is it possible?
> >
> > when marshalling to csv file
> >
> > Thx
> >
> > M
> 
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -
> >>> http://davsclaus.com @davsclaus
> >>> Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


RE: Re: Bindy plus Unicode

2020-01-24 Thread Michael Greulich


Hi Alex, 

well, your comment was already very helpful. I created a custom DataFormat and 
ModelFactory from the default ones for FixedLength. Of course I obeyed the 
license terms of the Apache license ;-) For some aspect of recognizing chars, I 
used the ICU4J-lib, because the support for some things (e.g. emojis) in the 
Java runtime is not up to date. The license of ICU it quite permitting, too. 
I’ve no idea, if this is a problem for an Apache project...

Well I think I’m not the only one, that has this use-case -- so I  think this 
can be useful for the community, too. Currently I’m under pressure, but I think 
I will create a JIRA ticket when the stress has become less. If the community 
is interested, I can provide the code of my solution and would be glad if this 
thing goes upstream (i.e. into the camel distro) some day. 

Currently we (the company I work for) are using Camel 2.2 and I guess this will 
be the case for some time. If this feature or bug (not very determined what it 
actually is, I will leave the decision to the community)  in which version will 
it be included? Only Camel 3.x or will it be backported to 2.2?

-- Mik
  
--
Gesendet: Freitag, 24. Januar 2020 um 11:43 Uhr
Von: "Alex Dettinger" 
An: users@camel.apache.org
Betreff: Re: Bindy plus Unicode
Hi Michael,

I was just looking at this component for another purpose and it looks
to me that fixed length tokenzation occurs here:

https://github.com/apache/camel/blob/master/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java#L212..L216
So, It counts in java chars and not code points. You can maybe experiment
injecting a custom BindyFixedLengthFactory, via
dataFormat.setModelFactory(..).

Would you feel that an extension point to customize count/selection of
chars/codepoint/grapheme would be valuable to the community, feel free to
raise a JIRA ticket.

Alex


On Fri, Jan 24, 2020 at 9:52 AM Michael Greulich 
wrote:

> Hi,
>
> I’m having problems with the bindy component and wonder if there is
> something I missed. Maybe one can help me addressing it. I cannot believe,
> that I’m the first to hit this problem.
>
> I need to port an EAI application built using bindy, that reads a fixed
> type file(*) converts it and sends the data somewhere else. Currently this
> file is in Latin 1 encoding, but we need to take it to Unicode –
> effectively UTF-8. We have an ugly, but effectively unavoidable legacy
> application that creates the file.
>
> Unicode is a bit tricky, when it comes to counting the length of a string
> specially since Java uses internally UTF-16, which means depending on the
> codepoint 1 – 2 (Java-)chars. Bindy seems to use internally for selection
> substring and counts chars like Java does. This means the length of a
> string is the count of the chars, i.e. UTF-16 surrogates, but not
> codepoints, which is the common denominator (e.g. see definition of string
> length in XMLSchema). And when one takes combing chars into account (one
> “base char” plus 0 – n combining chars are perceived as one “char” by
> users) it becomes even more of a problem.
>
> Is there a possibility to tell bindy how it counts an and selects the
> tokens based on char counts in a given line? Any suggestions? Is the are
> related bug or change to come that addresses this problem?
>
> -- Mik
>
> (*) This means, that on certain positions there start certain data
> (columns if you will).
>
>
 
 


Re: Re: Bindy plus Unicode

2020-01-24 Thread Alex Dettinger
Hi Michael,

  Good to know that you sorted it out :) The compatibility between the
ICU4L and Apache License is not straightforward, we would need to look
closer.
Still creating a quick ticket and sharing a github project would make it
possible to save your work, and may be of interest later on to the
community.
  Would one provide a PR against 3.x, chances are that this could be
back-ported to 2.x. Please, keep time frame in mind as 2.x may close end of
this year.

Alex

On Fri, Jan 24, 2020 at 5:20 PM Michael Greulich 
wrote:

>
> Hi Alex,
>
> well, your comment was already very helpful. I created a custom DataFormat
> and ModelFactory from the default ones for FixedLength. Of course I obeyed
> the license terms of the Apache license ;-) For some aspect of recognizing
> chars, I used the ICU4J-lib, because the support for some things (e.g.
> emojis) in the Java runtime is not up to date. The license of ICU it quite
> permitting, too. I’ve no idea, if this is a problem for an Apache project...
>
> Well I think I’m not the only one, that has this use-case -- so I  think
> this can be useful for the community, too. Currently I’m under pressure,
> but I think I will create a JIRA ticket when the stress has become less. If
> the community is interested, I can provide the code of my solution and
> would be glad if this thing goes upstream (i.e. into the camel distro) some
> day.
>
> Currently we (the company I work for) are using Camel 2.2 and I guess this
> will be the case for some time. If this feature or bug (not very determined
> what it actually is, I will leave the decision to the community)  in which
> version will it be included? Only Camel 3.x or will it be backported to 2.2?
>
> -- Mik
>
> --
> Gesendet: Freitag, 24. Januar 2020 um 11:43 Uhr
> Von: "Alex Dettinger" 
> An: users@camel.apache.org
> Betreff: Re: Bindy plus Unicode
> Hi Michael,
>
> I was just looking at this component for another purpose and it looks
> to me that fixed length tokenzation occurs here:
>
>
> https://github.com/apache/camel/blob/master/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java#L212..L216
> So, It counts in java chars and not code points. You can maybe experiment
> injecting a custom BindyFixedLengthFactory, via
> dataFormat.setModelFactory(..).
>
> Would you feel that an extension point to customize count/selection of
> chars/codepoint/grapheme would be valuable to the community, feel free to
> raise a JIRA ticket.
>
> Alex
>
>
> On Fri, Jan 24, 2020 at 9:52 AM Michael Greulich <
> mich...@greulich-online.eu>
> wrote:
>
> > Hi,
> >
> > I’m having problems with the bindy component and wonder if there is
> > something I missed. Maybe one can help me addressing it. I cannot
> believe,
> > that I’m the first to hit this problem.
> >
> > I need to port an EAI application built using bindy, that reads a fixed
> > type file(*) converts it and sends the data somewhere else. Currently
> this
> > file is in Latin 1 encoding, but we need to take it to Unicode –
> > effectively UTF-8. We have an ugly, but effectively unavoidable legacy
> > application that creates the file.
> >
> > Unicode is a bit tricky, when it comes to counting the length of a string
> > specially since Java uses internally UTF-16, which means depending on the
> > codepoint 1 – 2 (Java-)chars. Bindy seems to use internally for selection
> > substring and counts chars like Java does. This means the length of a
> > string is the count of the chars, i.e. UTF-16 surrogates, but not
> > codepoints, which is the common denominator (e.g. see definition of
> string
> > length in XMLSchema). And when one takes combing chars into account (one
> > “base char” plus 0 – n combining chars are perceived as one “char” by
> > users) it becomes even more of a problem.
> >
> > Is there a possibility to tell bindy how it counts an and selects the
> > tokens based on char counts in a given line? Any suggestions? Is the are
> > related bug or change to come that addresses this problem?
> >
> > -- Mik
> >
> > (*) This means, that on certain positions there start certain data
> > (columns if you will).
> >
> >
>
>
>


Re: Bindy dataformat and ZonedDateTime

2020-05-05 Thread Claus Ibsen
Hi

I am not sure if there is a reason not. You are welcome to create a
JIRA and work on a PR to add this to Camel.
Mind it has to be on master branch for Camel 3.x.


On Tue, May 5, 2020 at 10:11 AM Alberto  wrote:
>
> Hello,
>
> I need to handle a ZonedDateTime attribute in a pojo with bindy dataformat. I
> found that ZonedDateTime is not handled wheras LocalDateTime is.
> Is there any particular reason for that?
>
> I solved writing a specific Format and using a @BindyConverter annotation but 
> in
> that way I'm unable to specify a pattern.
>
> Best regards
>
> Alberto
>


-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Bindy dataformat and ZonedDateTime

2020-05-06 Thread Alberto


Ok, the patch is ready.
I will try to create a PR.


On Tue, 2020-05-05 at 10:15 +0200, Claus Ibsen wrote:
> Hi
> 
> I am not sure if there is a reason not. You are welcome to create a
> JIRA and work on a PR to add this to Camel.
> Mind it has to be on master branch for Camel 3.x.
> 
> 
> On Tue, May 5, 2020 at 10:11 AM Alberto  wrote:
> > Hello,
> > 
> > I need to handle a ZonedDateTime attribute in a pojo with bindy dataformat.
> > I
> > found that ZonedDateTime is not handled wheras LocalDateTime is.
> > Is there any particular reason for that?
> > 
> > I solved writing a specific Format and using a @BindyConverter annotation
> > but in
> > that way I'm unable to specify a pattern.
> > 
> > Best regards
> > 
> > Alberto
> > 
> 
> 



Re: Bindy and special formats

2011-11-09 Thread Christian Müller
Good finding.
We should of cure support this kind of format.

Could you please open a JIRA for it.
And do you consider providing a patch for it? You may know we love
contributions... ;-)

Best,
Christian


Re: Bindy and special formats

2011-11-09 Thread olivierursushorribilis

Here it is : https://issues.apache.org/jira/browse/CAMEL-4655

For the patch i will have a look but actually i don't know camel internals,
maybe in few months.

Thanks.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-and-special-formats-tp4977986p4980286.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy Date Pattern Error

2013-07-09 Thread Christian Müller
How dos your date looks like?
Which version of Camel do you use?
I added an unit test to 2.12-SNAPSHOT [1] which show does it works (at
least with this version).

[1]
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/date/BindyDatePatternCsvUnmarshallTest.java;h=71184cef4acce98a3bfe36c32efd574b5f7d00f1;hb=HEAD

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Jul 9, 2013 at 8:31 PM,  wrote:

> Hi,
> Can you please advise regarding Date Pattern exception in Bindy.
>
> We are using Bindy to marshal, We have a attribute with data type as DATE.
>
> We are getting the below exception during the parsing.
>
> java.lang.IllegalArgumentException: Can not find a suitable formatter for
> the type: java.sql.Date
> Annotation model snippet is below.
>
> @DataField(pos=41, length=10,pattern="MM-dd-")
>   private Date settlement_date;
> Thanks
> Ganesh
>
>
>
>
>
> ___
>
> This message is for information purposes only, it is not a recommendation,
> advice, offer or solicitation to buy or sell a product or service nor an
> official confirmation of any transaction. It is directed at persons who are
> professionals and is not intended for retail customer use. Intended for
> recipient only. This message is subject to the terms at:
> www.barclays.com/emaildisclaimer.
>
> For important disclosures, please see:
> www.barclays.com/salesandtradingdisclaimer regarding market commentary
> from Barclays Sales and/or Trading, who are active market participants; and
> in respect of Barclays Research, including disclosures relating to specific
> issuers, please see http://publicresearch.barclays.com.
>
> ___
>


Re: Bindy Date Pattern Error

2013-07-09 Thread Babak Vahdat
Hi

As the test being added by Christian already demonstrates it, you should
make use of the java.util.Date and NOT java.sql.Date. Following are the
formats being supported:

http://camel.apache.org/maven/current/camel-bindy/apidocs/org/apache/camel/dataformat/bindy/Format.html

Feel free to log a JIRA if you really need the support for the java.sql.Date
data type.

Babak


ganeshkumar.kanagavel wrote
> Hi,
> Can you please advise regarding Date Pattern exception in Bindy.
> 
> We are using Bindy to marshal, We have a attribute with data type as DATE.
> 
> We are getting the below exception during the parsing.
> 
> java.lang.IllegalArgumentException: Can not find a suitable formatter for
> the type: java.sql.Date
> Annotation model snippet is below.
> 
> @DataField(pos=41, length=10,pattern="MM-dd-")
>   private Date settlement_date;
> Thanks
> Ganesh
> 
> 
> 
> 
> 
> ___
> 
> This message is for information purposes only, it is not a recommendation,
> advice, offer or solicitation to buy or sell a product or service nor an
> official confirmation of any transaction. It is directed at persons who
> are professionals and is not intended for retail customer use. Intended
> for recipient only. This message is subject to the terms at:
> www.barclays.com/emaildisclaimer.
> 
> For important disclosures, please see:
> www.barclays.com/salesandtradingdisclaimer regarding market commentary
> from Barclays Sales and/or Trading, who are active market participants;
> and in respect of Barclays Research, including disclosures relating to
> specific issuers, please see http://publicresearch.barclays.com.
> 
> ___





--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-Date-Pattern-Error-tp5735367p5735380.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Bindy Date Pattern Error

2013-07-11 Thread ganeshkumar.kanagavel
Hi,
We are using camel version 2.11

Our data format is in the format of YYMMDD , Unmarshalling is failing if we use 
java.sql.date but works with java.util.date.

But java.util.date is not compliant with sql server database insert, so we need 
to add some conversion logic in the get method of the Model.

Thanks
Ganesh

-Original Message-
From: Christian Müller [mailto:christian.muel...@gmail.com] 
Sent: Tuesday, July 09, 2013 4:32 PM
To: users@camel.apache.org
Subject: Re: Bindy Date Pattern Error

How dos your date looks like?
Which version of Camel do you use?
I added an unit test to 2.12-SNAPSHOT [1] which show does it works (at least 
with this version).

[1]
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/date/BindyDatePatternCsvUnmarshallTest.java;h=71184cef4acce98a3bfe36c32efd574b5f7d00f1;hb=HEAD

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team V.P. Apache Camel: 
https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Jul 9, 2013 at 8:31 PM,  wrote:

> Hi,
> Can you please advise regarding Date Pattern exception in Bindy.
>
> We are using Bindy to marshal, We have a attribute with data type as DATE.
>
> We are getting the below exception during the parsing.
>
> java.lang.IllegalArgumentException: Can not find a suitable formatter 
> for the type: java.sql.Date Annotation model snippet is below.
>
> @DataField(pos=41, length=10,pattern="MM-dd-")
>   private Date settlement_date;
> Thanks
> Ganesh
>
>
>
>
>
> ___
>
> This message is for information purposes only, it is not a 
> recommendation, advice, offer or solicitation to buy or sell a product 
> or service nor an official confirmation of any transaction. It is 
> directed at persons who are professionals and is not intended for 
> retail customer use. Intended for recipient only. This message is subject to 
> the terms at:
> www.barclays.com/emaildisclaimer.
>
> For important disclosures, please see:
> www.barclays.com/salesandtradingdisclaimer regarding market commentary 
> from Barclays Sales and/or Trading, who are active market 
> participants; and in respect of Barclays Research, including 
> disclosures relating to specific issuers, please see 
> http://publicresearch.barclays.com.
>
> ___
>
___

This message is for information purposes only, it is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is not intended for retail customer use. Intended for 
recipient only. This message is subject to the terms at: 
www.barclays.com/emaildisclaimer.

For important disclosures, please see: 
www.barclays.com/salesandtradingdisclaimer regarding market commentary from 
Barclays Sales and/or Trading, who are active market participants; and in 
respect of Barclays Research, including disclosures relating to specific 
issuers, please see http://publicresearch.barclays.com.

___


Re: Bindy Streaming Multile Rows

2013-12-10 Thread Charles Moulliard
You are right, bindy does not support this option. If you have a patch, you
are welcome to submit it.


On Fri, Dec 6, 2013 at 9:28 PM, Daneel Yaitskov wrote:

> Hi,
>
> I found 2 streaming solutions:
>
> body().tokenizer("\n")
>
> and
>
> from("stream:file?fileName=data/export-2013-10-24-all.csv")
>
> None off them support multile rows.
>
> Such as:
>
> 1234, " first
> row
> "
> 24533, next row
>
>
> Both solution act on low level before CSV. So it's not a surprise that they
> cannot cope with multi line rows because this is CSV format feature. And
> they should be solved by Bindy itself.
>
> I guess Bindy haven't such feature yet.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-Streaming-Multile-Rows-tp5744413.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Bindy - Date Unmarshall Issue

2015-02-24 Thread Charles Moulliard
Hi,

Can you provide an example that we could test as the date pattern used
seems good. So, we should have a look to the code to see why it failed for
you.

Regards,


On Fri, Feb 20, 2015 at 2:00 AM, kc525 
wrote:

> I ran into an issue with Apache Camel Bindy data format for the Date field
> parsing from a CSV file.
>
> *Date in the CSV : 02/11/2015 03:34:49 PM.*
>
> Format in the Bindy Class annotated as
>
> *@DataField(pos = 8,pattern="MM/dd/ hh:mm:ss a")
> private Date time;*
>
> Getting below exception
>
> java.lang.IllegalArgumentException: Date provided does not fit the pattern
> defined, position: 8, line: 1 at
>
> org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.java:213)
> at
>
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:185)
> at
>
> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67)
> It works if the date in the CSV is given as 2/11/2015 03:34:49 PM, with no
> preceeding 0 in the Month field.
>
> I am using Camel 2.14.1.
>
> Am I doing anything wrong here ? Please advise.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-Date-Unmarshall-Issue-tp5762960.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Bindy - Date Unmarshall Issue

2015-03-04 Thread Claus Ibsen
Hi

It seems because bindy uses strict parsing by setting lenient = false

df.setLenient(false);
date = df.parse(string);

It should maybe not do that, and just use SimpleDataFormat parsing as
default out of the box.




On Fri, Feb 20, 2015 at 2:00 AM, kc525  wrote:
> I ran into an issue with Apache Camel Bindy data format for the Date field
> parsing from a CSV file.
>
> *Date in the CSV : 02/11/2015 03:34:49 PM.*
>
> Format in the Bindy Class annotated as
>
> *@DataField(pos = 8,pattern="MM/dd/ hh:mm:ss a")
> private Date time;*
>
> Getting below exception
>
> java.lang.IllegalArgumentException: Date provided does not fit the pattern
> defined, position: 8, line: 1 at
> org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.java:213)
> at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:185)
> at
> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67)
> It works if the date in the CSV is given as 2/11/2015 03:34:49 PM, with no
> preceeding 0 in the Month field.
>
> I am using Camel 2.14.1.
>
> Am I doing anything wrong here ? Please advise.
>
> Thanks.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-Date-Unmarshall-Issue-tp5762960.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: bindy - process fixed length records?

2010-05-27 Thread Charles Moulliard
Hi raymond,

Fixed length format is not yet supported by bindy -->
https://issues.apache.org/activemq/browse/CAMEL-2731

I will try to work on that soon.

Kind regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel/ServiceMix Committer

***
- Blog : http://cmoulliard.blogspot.com
- Twitter : http://twitter.com/cmoulliard
- Linkedlin : http://www.linkedin.com/in/charlesmoulliard



On Thu, May 27, 2010 at 5:19 PM, McDermott Raymond
 wrote:
>
> Guys I have a fixed input file thus:
>
> ##H##0     FGBGH5JE20100202               0100
> JBJCBD44 655F0044001106/10/2009K-50600
> JBJCBD44 655F0045001124/09/2009K-50700
> JBJCBD442653F0042001116/10/2009K-51300
> JBJCBD60 758F0001004302/10/2009KY-1400
>
> I would like to use Bindy but cannot find a way in the docs to say that
> there is no separator.  Is it just "" or should I go and read the code ;-)
>
> Thanks in advance for your help
>
> Ray
> --
> View this message in context: 
> http://old.nabble.com/bindy---process-fixed-length-records--tp28693931p28693931.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Bindy to ignore empty lines?

2022-04-27 Thread Mikael Andersson Wigander
nevermind




/M


--- Original Message ---
On Wednesday, April 27th, 2022 at 13:08, Mikael Andersson Wigander 
 wrote:


> Hi
>
> How can one make Bindy understand to ignore a file with empty lines?
> I can't find any options for it.
>
> In empty I mean a csv file with two or more CR/LF at the end of the file…
>
> A,B,C,D
> E,F,G,H
> 
>
> 
>
> 
>
>
> 
>
>
>
>
> /M


Re: Bindy : CSV Header is incorrect

2012-08-16 Thread Charles Moulliard
Hi

Can you enable to DEBUG org.apache.camel.dataformat.bindy (log4j, ...) to
control which classes (= models) have been loaded by camel on your linux
machine ?

Regards,

Charles



On Thu, Aug 16, 2012 at 3:17 PM, houssemgaga
wrote:

> Hello,
>
> I use the library Bindy for quite some time, and she is great .
> However, I recently found a problem. Let me explain:
> I'm developing on Windows machine, everything goes well. Once deployed on
> the target machine (Linux), csv files generated are not correct: the header
> is not good.
> In fact, I created for each file type csv a model object, in each package
> separately. There are common fields between the models and the concern
> comes
> from there: camel-bindy is lost when generating the header. The generated
> header contains fields that come from another model.
>
> An example :
> *Model 1 :*
> @CsvRecord(separator=";", generateHeaderColumns=true, skipFirstLine=true)
>  public class OpportunityDTO implements Serializable{
>
> /**
>  *
>  */
> private static final long serialVersionUID = 1L;
>
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
>
> @DataField(columnName = "AccountId", pos = 2 )
> String accountId;
>
> @DataField(columnName = "Country", pos = 3 )
> String country;
>
> @DataField(columnName = "OpportunityType", pos = 4 )
> String opportunityType;
>
> @DataField(columnName = "ValidStartDate", pos = 5, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
>
> @DataField(columnName = "ValidEndDate", pos = 6, pattern
> ="\"dd/MM/\""
> )
> Date validEndDate;
>
> @DataField(columnName = "OpportunityCurrency", pos = 7 )
> String opportunityCurrency;
>
> @DataField(columnName = "ParentOpportunityId", pos = 8 )
> String parentOpportunityId;
>
> @DataField(columnName = "SalesMonitoring", pos = 9 )
> String salesMonitoring;
>
> // Getter and setter
> }
>
> *Model 2 :*
> @CsvRecord(separator=";", generateHeaderColumns=true,
> skipFirstLine=true)
> public class OpportunityLeaserDTO {
>
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
>
> @DataField(columnName = "LeaserId", pos = 2 )
> String leaserID;
>
> @DataField(columnName = "ValidStartDate", pos = 3, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
>
> @DataField(columnName = "ValidEndDate", pos = 4, pattern
> ="\"dd/MM/\""
> )
> Date validEndDate;
> // Getter and setter
> }
>
>
>
> For the first model "OpportunityDTO", the header is incorrect and generated
> as follows:
>
> OpportunityId;*LeaserId*;*ValidStartDate*;*ValidEndDate*;Country;ValidStartDate;ValidEndDate;ParentOpportunityId;SalesMonitoring
>
> For the second model "OpportunityLeaserDTO" the generated header is correct
>
> I still do not understand where is the problem and why only on linux???
>
> I use the latest release of Bindy: 2.10.0
>
> Thank you for your support.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-CSV-Header-is-incorrect-tp5717531.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com


Re: Bindy : CSV Header is incorrect

2012-08-16 Thread Willem jiang
It could be easier for use if you can provide a simple test case to reproduce 
the error.


-- 
Willem Jiang

FuseSource
Web: http://www.fusesource.com (http://www.fusesource.com/)
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang



On Thursday, August 16, 2012 at 9:17 PM, houssemgaga wrote:

> Hello,
> 
> I use the library Bindy for quite some time, and she is great .
> However, I recently found a problem. Let me explain:
> I'm developing on Windows machine, everything goes well. Once deployed on
> the target machine (Linux), csv files generated are not correct: the header
> is not good.
> In fact, I created for each file type csv a model object, in each package
> separately. There are common fields between the models and the concern comes
> from there: camel-bindy is lost when generating the header. The generated
> header contains fields that come from another model.
> 
> An example :
> *Model 1 :*
> @CsvRecord(separator=";", generateHeaderColumns=true, skipFirstLine=true) 
> public class OpportunityDTO implements Serializable{
> 
> /**
> * 
> */
> private static final long serialVersionUID = 1L;
> 
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
> 
> @DataField(columnName = "AccountId", pos = 2 )
> String accountId;
> 
> @DataField(columnName = "Country", pos = 3 )
> String country;
> 
> @DataField(columnName = "OpportunityType", pos = 4 )
> String opportunityType;
> 
> @DataField(columnName = "ValidStartDate", pos = 5, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
> 
> @DataField(columnName = "ValidEndDate", pos = 6, pattern ="\"dd/MM/\""
> )
> Date validEndDate;
> 
> @DataField(columnName = "OpportunityCurrency", pos = 7 )
> String opportunityCurrency;
> 
> @DataField(columnName = "ParentOpportunityId", pos = 8 )
> String parentOpportunityId;
> 
> @DataField(columnName = "SalesMonitoring", pos = 9 )
> String salesMonitoring;
> 
> // Getter and setter
> }
> 
> *Model 2 :*
> @CsvRecord(separator=";", generateHeaderColumns=true, skipFirstLine=true)
> public class OpportunityLeaserDTO {
> 
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
> 
> @DataField(columnName = "LeaserId", pos = 2 )
> String leaserID;
> 
> @DataField(columnName = "ValidStartDate", pos = 3, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
> 
> @DataField(columnName = "ValidEndDate", pos = 4, pattern ="\"dd/MM/\""
> )
> Date validEndDate;
> // Getter and setter
> }
> 
> 
> 
> For the first model "OpportunityDTO", the header is incorrect and generated
> as follows:
> OpportunityId;*LeaserId*;*ValidStartDate*;*ValidEndDate*;Country;ValidStartDate;ValidEndDate;ParentOpportunityId;SalesMonitoring
> 
> For the second model "OpportunityLeaserDTO" the generated header is correct
> 
> I still do not understand where is the problem and why only on linux???
> 
> I use the latest release of Bindy: 2.10.0
> 
> Thank you for your support.
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-CSV-Header-is-incorrect-tp5717531.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: Bindy : CSV Header is incorrect

2012-08-16 Thread Claus Ibsen
I wonder if its related to line terminators on windows vs linux being different.
There is an option on bindy to set if its windows, mac or unix. (I think)



On Thu, Aug 16, 2012 at 3:17 PM, houssemgaga
 wrote:
> Hello,
>
> I use the library Bindy for quite some time, and she is great .
> However, I recently found a problem. Let me explain:
> I'm developing on Windows machine, everything goes well. Once deployed on
> the target machine (Linux), csv files generated are not correct: the header
> is not good.
> In fact, I created for each file type csv a model object, in each package
> separately. There are common fields between the models and the concern comes
> from there: camel-bindy is lost when generating the header. The generated
> header contains fields that come from another model.
>
> An example :
> *Model 1 :*
> @CsvRecord(separator=";", generateHeaderColumns=true, skipFirstLine=true)
>  public class OpportunityDTO implements Serializable{
>
> /**
>  *
>  */
> private static final long serialVersionUID = 1L;
>
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
>
> @DataField(columnName = "AccountId", pos = 2 )
> String accountId;
>
> @DataField(columnName = "Country", pos = 3 )
> String country;
>
> @DataField(columnName = "OpportunityType", pos = 4 )
> String opportunityType;
>
> @DataField(columnName = "ValidStartDate", pos = 5, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
>
> @DataField(columnName = "ValidEndDate", pos = 6, pattern 
> ="\"dd/MM/\""
> )
> Date validEndDate;
>
> @DataField(columnName = "OpportunityCurrency", pos = 7 )
> String opportunityCurrency;
>
> @DataField(columnName = "ParentOpportunityId", pos = 8 )
> String parentOpportunityId;
>
> @DataField(columnName = "SalesMonitoring", pos = 9 )
> String salesMonitoring;
>
> // Getter and setter
> }
>
> *Model 2 :*
> @CsvRecord(separator=";", generateHeaderColumns=true, 
> skipFirstLine=true)
> public class OpportunityLeaserDTO {
>
> @DataField(columnName = "OpportunityId", pos = 1 )
> String opportunityId;
>
> @DataField(columnName = "LeaserId", pos = 2 )
> String leaserID;
>
> @DataField(columnName = "ValidStartDate", pos = 3, pattern
> ="\"dd/MM/\"" )
> Date validStartDate;
>
> @DataField(columnName = "ValidEndDate", pos = 4, pattern 
> ="\"dd/MM/\""
> )
> Date validEndDate;
> // Getter and setter
> }
>
>
>
> For the first model "OpportunityDTO", the header is incorrect and generated
> as follows:
> OpportunityId;*LeaserId*;*ValidStartDate*;*ValidEndDate*;Country;ValidStartDate;ValidEndDate;ParentOpportunityId;SalesMonitoring
>
> For the second model "OpportunityLeaserDTO" the generated header is correct
>
> I still do not understand where is the problem and why only on linux???
>
> I use the latest release of Bindy: 2.10.0
>
> Thank you for your support.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-CSV-Header-is-incorrect-tp5717531.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Bindy : CSV Header is incorrect

2012-08-17 Thread houssemgaga
Hello,

Thank you for your responses.

I just found where it comes from the problem. The process of scanning to
find the package on Windows models is different on linux (due to
classloading, I think).
In fact the two models in my example is successively in the following
packages:
- Model 1: *com. [...].opportunity*
- Model 2: *com. [...].opportunity*leaser

Scanning the package "com. [...].opportunity" on Windows return the model
OpportrunityDTO by cons on Linux returns the two models (ie it has also
scanned the second package). So, we found in the CSV header the fields of
the 2nd model they have the same "pos" as in model 1. I think the
classloading policy is différent between Linux and Windows. So to correct
the problem, i changed the package names.

And here are the logs:

- Before:

2012-08-16 16:39:22,164 DEBUG
(org.apache.camel.impl.DefaultPackageScanClassResolver:160) - Found: [class
com.sfl.dto.csv.opportunity.OpportunitiesDTO, class
comsfl.dto.csv.opportunity.OpportunityDTO, class
com.sfl.dto.csv.opportunitydealer.OpportunityDealerDTO, class
com.sfl.dto.csv.opportunityleaser.OpportunityLeaserDTO]
2012-08-16 16:39:22,164 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:107) - Class retrieved: *
com.sfl.dto.csv.opportunity.OpportunitiesDTO*
2012-08-16 16:39:22,165 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 1,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=OpportunityId, required=false, defaultValue=, trim=false, pos=1)
2012-08-16 16:39:22,166 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 2,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=AccountId, required=false, defaultValue=, trim=false, pos=2)
2012-08-16 16:39:22,167 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 3,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=Country, required=false, defaultValue=, trim=false, pos=3)
2012-08-16 16:39:22,167 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 4,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=OpportunityType, required=false, defaultValue=, trim=false,
pos=4)
2012-08-16 16:39:22,168 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 5,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern="dd/MM/", align=R, paddingChar= ,
name=, length=0, columnName=ValidStartDate, required=false, defaultValue=,
trim=false, pos=5)
2012-08-16 16:39:22,169 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 6,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern="dd/MM/", align=R, paddingChar= ,
name=, length=0, columnName=ValidEndDate, required=false, defaultValue=,
trim=false, pos=6)
2012-08-16 16:39:22,169 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 7,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=OpportunityCurrency, required=false, defaultValue=, trim=false,
pos=7)
2012-08-16 16:39:22,170 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 8,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=ParentOpportunityId, required=false, defaultValue=, trim=false,
pos=8)
2012-08-16 16:39:22,171 DEBUG
(org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined
in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 9,
Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false,
position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0,
columnName=SalesMonitoring, required=false, defaultValue=, trim=false,
pos=9)
2012-08-16 16:39:22,171 DEBUG
(org.apache.ca

Re: Bindy/JBoss 7 classloading problems

2013-01-20 Thread dont_know
Hello,

I've discovered a classloading problem when using Bindy (from Camel 2.10) in
a JBoss 7 environment. Camel itself works great, but Bindy fails, because it
uses the "build-in" classloading strategy which doesn't support the
VFS-protocol.

My current solution is to register the JBossPackageScanClassResolver from
camel-jboss6-extras (http://camel.apache.org/camel-jboss.html) in the route
context. This is a little bit strange, because the documentation states that
Camel 2.8 (or greater) should work fine without
JBossPackageScanClassResolver.

My question is: Is the documentation incorrect or is it a bug?

Greetings
  Stefan 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-JBoss-7-classloading-problems-tp5725684p5725865.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy/JBoss 7 classloading problems

2013-01-20 Thread Claus Ibsen
On Mon, Jan 21, 2013 at 8:37 AM, dont_know  wrote:
> Hello,
>
> I've discovered a classloading problem when using Bindy (from Camel 2.10) in
> a JBoss 7 environment. Camel itself works great, but Bindy fails, because it
> uses the "build-in" classloading strategy which doesn't support the
> VFS-protocol.
>
> My current solution is to register the JBossPackageScanClassResolver from
> camel-jboss6-extras (http://camel.apache.org/camel-jboss.html) in the route
> context. This is a little bit strange, because the documentation states that
> Camel 2.8 (or greater) should work fine without
> JBossPackageScanClassResolver.
>
> My question is: Is the documentation incorrect or is it a bug?
>

camel-bindy is a special case that needs this. In the future camel-bindy will be
refactored to avoid this need.



> Greetings
>   Stefan
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-JBoss-7-classloading-problems-tp5725684p5725865.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy/FixedLength/encoding/optional fields

2013-01-24 Thread Claus Ibsen
Hi

Have you looked at beanio. Its a great library
http://camel.apache.org/beanio



On Thu, Jan 24, 2013 at 10:41 AM, Walzer, Thomas
 wrote:
> Hi all,
>
> I see strange behaviour in camel-bindy:
>
> 1) When I unmarshal a fixed-length file I get errors when the file is encoded 
> in e.g. UTF-8. It seems that characters that need multiple bytes to encode 
> confuse the parser/scanner. There was a JIRA with regard to bindy-csv but 
> nothing bindy-fixed.
>
> 2) The length parameter in the fixedlength-annotation is required (otherwise 
> it is 0). Wouldn´t it be nice if this were computed. It would be great to 
> have optional fixed-length fields (like in old host files). Or do I have to 
> go the smooks-route?
>
> Regards, Thomas.
>
>



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Bindy/FixedLength/encoding/optional fields

2013-01-24 Thread Walzer, Thomas

BeanIO looks great, I´ll give it a try. So many libraries - so little time. 
Thank you Claus.



Am 24.01.2013 um 10:49 schrieb Claus Ibsen :

> Hi
> 
> Have you looked at beanio. Its a great library
> http://camel.apache.org/beanio
> 
> 
> 
> On Thu, Jan 24, 2013 at 10:41 AM, Walzer, Thomas
>  wrote:
>> Hi all,
>> 
>> I see strange behaviour in camel-bindy:
>> 
>> 1) When I unmarshal a fixed-length file I get errors when the file is 
>> encoded in e.g. UTF-8. It seems that characters that need multiple bytes to 
>> encode confuse the parser/scanner. There was a JIRA with regard to bindy-csv 
>> but nothing bindy-fixed.
>> 
>> 2) The length parameter in the fixedlength-annotation is required (otherwise 
>> it is 0). Wouldn´t it be nice if this were computed. It would be great to 
>> have optional fixed-length fields (like in old host files). Or do I have to 
>> go the smooks-route?
>> 
>> Regards, Thomas.
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



RE: Bindy Data Format Unmarshalling question

2017-08-26 Thread Goodwin, Matthew
Never mind. Problem solved.

Thanks,

Matt

-Original Message-
From: Goodwin, Matthew
Sent: Sunday, August 27, 2017 12:01 AM
To: users@camel.apache.org
Subject: Bindy Data Format Unmarshalling question

Hi Camel Community,
  I am using Bindy to format a file that has a header, footer, and one to many 
detail records. Things are working fine but it looks like within the 
BindyAbstractDataFormat class in the extractUnmarshalResult method it checks to 
see if there is one or multiple records. If it is one then it returns an 
instance of the object if it is multiple it returns a List of the object. In my 
code I am checking with intanceof to see which it is. Is there a more elegant 
solution to this?

Thanks,

Matt




This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.



This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system manager. This 
message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.


RE: Re: Re: Bindy plus Unicode

2020-01-25 Thread dev


Hi Alex,
 
well, which would then be the appropriate branch? Master or 3.x? 
I guess if i create a ticket I get informed by e-mail what happens to the 
thing, right?
I think there could be a ticket + PR in the next two weeks. 

I word on ICU4J. Of course I understand, that an Apache Project has to be 
careful, but there 
are features like splitting strings into graphemes, that need features, the old 
logic in the JDK
doesn't support. The lib is very common (e.g. LibreOffice uses it) and AFAIK 
the de-facto standard
for working with elaborate Unicode. 

-- Mik
 

Gesendet: Freitag, 24. Januar 2020 um 19:15 Uhr
Von: "Alex Dettinger" 
An: users@camel.apache.org
Betreff: Re: Re: Bindy plus Unicode
Hi Michael,

Good to know that you sorted it out :) The compatibility between the
ICU4L and Apache License is not straightforward, we would need to look
closer.
Still creating a quick ticket and sharing a github project would make it
possible to save your work, and may be of interest later on to the
community.
Would one provide a PR against 3.x, chances are that this could be
back-ported to 2.x. Please, keep time frame in mind as 2.x may close end of
this year.

Alex

On Fri, Jan 24, 2020 at 5:20 PM Michael Greulich 
wrote:

>
> Hi Alex,
>
> well, your comment was already very helpful. I created a custom DataFormat
> and ModelFactory from the default ones for FixedLength. Of course I obeyed
> the license terms of the Apache license ;-) For some aspect of recognizing
> chars, I used the ICU4J-lib, because the support for some things (e.g.
> emojis) in the Java runtime is not up to date. The license of ICU it quite
> permitting, too. I’ve no idea, if this is a problem for an Apache project...
>
> Well I think I’m not the only one, that has this use-case -- so I think
> this can be useful for the community, too. Currently I’m under pressure,
> but I think I will create a JIRA ticket when the stress has become less. If
> the community is interested, I can provide the code of my solution and
> would be glad if this thing goes upstream (i.e. into the camel distro) some
> day.
>
> Currently we (the company I work for) are using Camel 2.2 and I guess this
> will be the case for some time. If this feature or bug (not very determined
> what it actually is, I will leave the decision to the community) in which
> version will it be included? Only Camel 3.x or will it be backported to 2.2?
>
> -- Mik
>
> --
> Gesendet: Freitag, 24. Januar 2020 um 11:43 Uhr
> Von: "Alex Dettinger" 
> An: users@camel.apache.org
> Betreff: Re: Bindy plus Unicode
> Hi Michael,
>
> I was just looking at this component for another purpose and it looks
> to me that fixed length tokenzation occurs here:
>
>
> https://github.com/apache/camel/blob/master/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java#L212..L216
> So, It counts in java chars and not code points. You can maybe experiment
> injecting a custom BindyFixedLengthFactory, via
> dataFormat.setModelFactory(..).
>
> Would you feel that an extension point to customize count/selection of
> chars/codepoint/grapheme would be valuable to the community, feel free to
> raise a JIRA ticket.
>
> Alex
>
>
> On Fri, Jan 24, 2020 at 9:52 AM Michael Greulich <
> mich...@greulich-online.eu>
> wrote:
>
> > Hi,
> >
> > I’m having problems with the bindy component and wonder if there is
> > something I missed. Maybe one can help me addressing it. I cannot
> believe,
> > that I’m the first to hit this problem.
> >
> > I need to port an EAI application built using bindy, that reads a fixed
> > type file(*) converts it and sends the data somewhere else. Currently
> this
> > file is in Latin 1 encoding, but we need to take it to Unicode –
> > effectively UTF-8. We have an ugly, but effectively unavoidable legacy
> > application that creates the file.
> >
> > Unicode is a bit tricky, when it comes to counting the length of a string
> > specially since Java uses internally UTF-16, which means depending on the
> > codepoint 1 – 2 (Java-)chars. Bindy seems to use internally for selection
> > substring and counts chars like Java does. This means the length of a
> > string is the count of the chars, i.e. UTF-16 surrogates, but not
> > codepoints, which is the common denominator (e.g. see definition of
> string
> > length in XMLSchema). And when one takes combing chars into account (one
> > “base char” plus 0 – n combining chars are perceived as one “char” by
> > users) it becomes even more of a problem.
> >
> > Is there a possibility to tell bindy how it counts an and selects the
> > tokens based on char counts in a given line? Any suggestions? Is the are
> > related bug or change to come that addresses this problem?
> >
> > -- Mik
> >
> > (*) This means, that on certain positions there start certain data
> > (columns if you will).
> >
> >
>
>
>
 
 


Re: Re: Re: Bindy plus Unicode

2020-01-27 Thread Alex Dettinger
Hi Michael,

  You would need to open a PR against master.
  Please, find some helpful information around contributions
https://camel.apache.org/manual/latest/contributing.html.

  I'm sure ICU4J is functionally great. However, license compatibility is a
legal matter, we don't really have choice.
  Could you please point to the ICU4J license you've been using ? I could
have a try with checking the compatibility.

Alex

On Sat, Jan 25, 2020 at 5:42 PM  wrote:

>
> Hi Alex,
>
> well, which would then be the appropriate branch? Master or 3.x?
> I guess if i create a ticket I get informed by e-mail what happens to the
> thing, right?
> I think there could be a ticket + PR in the next two weeks.
>
> I word on ICU4J. Of course I understand, that an Apache Project has to be
> careful, but there
> are features like splitting strings into graphemes, that need features,
> the old logic in the JDK
> doesn't support. The lib is very common (e.g. LibreOffice uses it) and
> AFAIK the de-facto standard
> for working with elaborate Unicode.
>
> -- Mik
>
> 
> Gesendet: Freitag, 24. Januar 2020 um 19:15 Uhr
> Von: "Alex Dettinger" 
> An: users@camel.apache.org
> Betreff: Re: Re: Bindy plus Unicode
> Hi Michael,
>
> Good to know that you sorted it out :) The compatibility between the
> ICU4L and Apache License is not straightforward, we would need to look
> closer.
> Still creating a quick ticket and sharing a github project would make it
> possible to save your work, and may be of interest later on to the
> community.
> Would one provide a PR against 3.x, chances are that this could be
> back-ported to 2.x. Please, keep time frame in mind as 2.x may close end of
> this year.
>
> Alex
>
> On Fri, Jan 24, 2020 at 5:20 PM Michael Greulich 
> wrote:
>
> >
> > Hi Alex,
> >
> > well, your comment was already very helpful. I created a custom
> DataFormat
> > and ModelFactory from the default ones for FixedLength. Of course I
> obeyed
> > the license terms of the Apache license ;-) For some aspect of
> recognizing
> > chars, I used the ICU4J-lib, because the support for some things (e.g.
> > emojis) in the Java runtime is not up to date. The license of ICU it
> quite
> > permitting, too. I’ve no idea, if this is a problem for an Apache
> project...
> >
> > Well I think I’m not the only one, that has this use-case -- so I think
> > this can be useful for the community, too. Currently I’m under pressure,
> > but I think I will create a JIRA ticket when the stress has become less.
> If
> > the community is interested, I can provide the code of my solution and
> > would be glad if this thing goes upstream (i.e. into the camel distro)
> some
> > day.
> >
> > Currently we (the company I work for) are using Camel 2.2 and I guess
> this
> > will be the case for some time. If this feature or bug (not very
> determined
> > what it actually is, I will leave the decision to the community) in which
> > version will it be included? Only Camel 3.x or will it be backported to
> 2.2?
> >
> > -- Mik
> >
> >
> --
> > Gesendet: Freitag, 24. Januar 2020 um 11:43 Uhr
> > Von: "Alex Dettinger" 
> > An: users@camel.apache.org
> > Betreff: Re: Bindy plus Unicode
> > Hi Michael,
> >
> > I was just looking at this component for another purpose and it looks
> > to me that fixed length tokenzation occurs here:
> >
> >
> >
> https://github.com/apache/camel/blob/master/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyFixedLengthFactory.java#L212..L216
> > So, It counts in java chars and not code points. You can maybe experiment
> > injecting a custom BindyFixedLengthFactory, via
> > dataFormat.setModelFactory(..).
> >
> > Would you feel that an extension point to customize count/selection of
> > chars/codepoint/grapheme would be valuable to the community, feel free to
> > raise a JIRA ticket.
> >
> > Alex
> >
> >
> > On Fri, Jan 24, 2020 at 9:52 AM Michael Greulich <
> > mich...@greulich-online.eu>
> > wrote:
> >
> > > Hi,
> > >
> > > I’m having problems with the bindy component and wonder if there is
> > > something I missed. Maybe one can help me addressing it. I cannot
> > believe,
> > > that I’m the first to hit this problem.
> > >
> > > I need to port an EAI application built using bindy, that reads a fixed
> > > type file(*) converts it and sends the data somewhere else. C

Re: Bindy running within a WAR

2015-03-30 Thread Claus Ibsen
Hi

What web server do you use for the War? Is it jetty or tomcat or something else?

Yeah bindy unfortunately uses that annotation scanning on classpath.
There is a ticket to improve this for the future.
You can impement a custom yourself that can load in the WAR.
http://camel.apache.org/pluggable-class-resolvers.html

On Mon, Mar 30, 2015 at 5:06 PM, Ted  wrote:
> Hi,
>
> I have a self executable Spring Boot (1.2.2) and Camel Boot (2.15.0)
> application built as a WAR.  My route makes use of Bindy to unmarshal CSV to
> my object class.  Everything work well when I run the code directly using
> Maven (mvn spring-boot:run) or if I run using Eclipse.  However if I build
> my WAR file and execute that (java -jar myWebApp.war) then I get errors
>
> java.lang.IllegalArgumentException: The separator has not been defined in
> the annotation @CsvRecord or not instantiated during initModel. must be
> specified
> at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:293)
> at
> org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:137)
> at
> org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
> at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
>
>
> In the Camel/Bindy code I can see that
> DefaultPackageScanClassResolver.loadImplementationsInJar obviously has
> special provision for jar files but what about the equivalent for WAR files?
> Class files are located under WEB-INF in war files which means my annotated
> classes are not being found.  See method
> DefaultPackageScanClassResolver.doLoadImplementationsInJar where the code is
> attempting to find classes that start with a particular package but will
> never find any because the file locations include WEB-INF, which would not
> be the case with a jar file.
>
> Is there another way of doing this or does Bindy need fixing?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Bindy running within a WAR

2015-03-31 Thread Ted
Thanks, I've created a PackageScanClassResolver for my project that works
with WAR files.

In the documentation http://camel.apache.org/pluggable-class-resolvers.html
it says I simply need to create a spring bean but when I tried the bean was
never referenced.  I had a quick look in DefaultCamelContext and
SpringCamelContext but all I could see was a hard coded reference to the
DefaultPackageScanClassResolver.  My Spring config looks like this:

@Bean
BeltPackageScanClassResolver beltResolver() {
BeltPackageScanClassResolver resolver = new
BeltPackageScanClassResolver();

return resolver;
}

Am I missing something?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765077.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy running within a WAR

2015-03-31 Thread Claus Ibsen
That is for using spring xml, with .

On Tue, Mar 31, 2015 at 12:59 PM, Ted  wrote:
> Thanks, I've created a PackageScanClassResolver for my project that works
> with WAR files.
>
> In the documentation http://camel.apache.org/pluggable-class-resolvers.html
> it says I simply need to create a spring bean but when I tried the bean was
> never referenced.  I had a quick look in DefaultCamelContext and
> SpringCamelContext but all I could see was a hard coded reference to the
> DefaultPackageScanClassResolver.  My Spring config looks like this:
>
> @Bean
> BeltPackageScanClassResolver beltResolver() {
> BeltPackageScanClassResolver resolver = new
> BeltPackageScanClassResolver();
>
> return resolver;
> }
>
> Am I missing something?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765077.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Bindy running within a WAR

2015-03-31 Thread Ted
Okay, thanks Claus.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765084.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy running within a WAR

2015-04-13 Thread RaviP
I'm facing the similar issue with my war.  I'm using wildfly 8.2.0 & Camel
2.14.1.  My route uses bindy to unmarshal csv to domain object. Junits are
working & war deployed on tomcat also works.

I'm getting the following exception when i deploy the war on wildfly 8.2.0

java.lang.IllegalArgumentException: The separator has not been defined in
the annotation @CsvRecord or not instantiated during initModel. must be
specified.

I see that a solution recommended was to use PackageScanClassResolver.

Can you please tell me how to do that incase of wildfly ?  Do i've to add
additional dependencies.

thanks
Ravi.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765711.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy running within a WAR

2015-04-13 Thread Charles Moulliard
Hi Ravi,

Have you tried to use the camel bindy "module" instead of packaging all the
deps within the war file (
http://wildflyext.gitbooks.io/wildfly-camel/content/components/camel-bindy.html,
http://wildflyext.gitbooks.io/wildfly-camel/content/start/index.html) ?

Regards,

On Mon, Apr 13, 2015 at 7:34 PM, RaviP 
wrote:

> I'm facing the similar issue with my war.  I'm using wildfly 8.2.0 & Camel
> 2.14.1.  My route uses bindy to unmarshal csv to domain object. Junits are
> working & war deployed on tomcat also works.
>
> I'm getting the following exception when i deploy the war on wildfly 8.2.0
>
> java.lang.IllegalArgumentException: The separator has not been defined in
> the annotation @CsvRecord or not instantiated during initModel. must be
> specified.
>
> I see that a solution recommended was to use PackageScanClassResolver.
>
> Can you please tell me how to do that incase of wildfly ?  Do i've to add
> additional dependencies.
>
> thanks
> Ravi.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765711.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Bindy running within a WAR

2015-04-15 Thread RaviP
I tried deploying the war in ... wildfly-camel-patch option ...I'm getting
LinkageError exception

I'm using ContextLoaderListener to load the camel context. 

 
org.springframework
spring-web
4.1.5.RELEASE


wildfly-camel-patch also contains 4.1.5.RELEASE.

thanks
Ravi.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765831.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy running within a WAR

2015-04-22 Thread RaviP
I've moved on by changing it to beanio.  

thanks
Ravi.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5766174.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Bindy running within a WAR

2015-04-23 Thread Bonnet Benjamin
Hi,
If you use it inside jBoss/wildfly, you should use jboss package scan class 
resolver. See camel-extra 
(https://code.google.com/a/apache-extras.org/p/camel-extra/).
Regards

-Message d'origine-
De : RaviP [mailto:ravikumar-penume...@hotmail.com] 
Envoyé : lundi 13 avril 2015 19:35
À : users@camel.apache.org
Objet : Re: Bindy running within a WAR

I'm facing the similar issue with my war.  I'm using wildfly 8.2.0 & Camel 
2.14.1.  My route uses bindy to unmarshal csv to domain object. Junits are 
working & war deployed on tomcat also works.

I'm getting the following exception when i deploy the war on wildfly 8.2.0

java.lang.IllegalArgumentException: The separator has not been defined in the 
annotation @CsvRecord or not instantiated during initModel. must be specified.

I see that a solution recommended was to use PackageScanClassResolver.

Can you please tell me how to do that incase of wildfly ?  Do i've to add 
additional dependencies.

thanks
Ravi.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035p5765711.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy CSV parser uses default encoding

2012-02-05 Thread Claus Ibsen
On Sat, Feb 4, 2012 at 2:10 PM, Thomas Letsch  wrote:
> Hi,
>
> the bindy csv component uses the default encoding when importing a file
> Class org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat Line 115:
> - InputStreamReader in = new InputStreamReader(inputStream);
> + InputStreamReader in = new InputStreamReader(inputStream,
> IOConverter.getCharsetName(exchange));
>
> the marshal method needs that probably too. This was already done for the
> standard CSV component:
> https://issues.apache.org/jira/browse/CAMEL-3483
>

Hi

Can you create a JIRA ticket for this?

> Regards,
> Thomas
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-CSV-parser-uses-default-encoding-tp5456136p5456136.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Bindy CSV parser uses default encoding

2012-02-06 Thread Thomas Letsch

Hi Claus,

thanks for the quick reply.

Ticket https://issues.apache.org/jira/browse/CAMEL-4983 is created.

Regards,
Thomas

On 05.02.2012 10:12, Claus Ibsen wrote:

On Sat, Feb 4, 2012 at 2:10 PM, Thomas Letsch  wrote:

Hi,

the bindy csv component uses the default encoding when importing a file
Class org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat Line 115:
- InputStreamReader in = new InputStreamReader(inputStream);
+ InputStreamReader in = new InputStreamReader(inputStream,
IOConverter.getCharsetName(exchange));

the marshal method needs that probably too. This was already done for the
standard CSV component:
https://issues.apache.org/jira/browse/CAMEL-3483


Hi

Can you create a JIRA ticket for this?


Regards,
Thomas

--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-CSV-parser-uses-default-encoding-tp5456136p5456136.html
Sent from the Camel - Users mailing list archive at Nabble.com.







Re: Bindy CSV parser uses default encoding

2012-02-07 Thread Willem Jiang

FYI, I filled a JIRA[1] and already committed the patch.

[1]https://issues.apache.org/jira/browse/CAMEL-4989

On 2/4/12 9:10 PM, Thomas Letsch wrote:

Hi,

the bindy csv component uses the default encoding when importing a file
Class org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat Line 115:
- InputStreamReader in = new InputStreamReader(inputStream);
+ InputStreamReader in = new InputStreamReader(inputStream,
IOConverter.getCharsetName(exchange));

the marshal method needs that probably too. This was already done for the
standard CSV component:
https://issues.apache.org/jira/browse/CAMEL-3483

Regards,
Thomas

--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-CSV-parser-uses-default-encoding-tp5456136p5456136.html
Sent from the Camel - Users mailing list archive at Nabble.com.




--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
 http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang


Re: Bindy CSV parser uses default encoding

2012-02-08 Thread Thomas Letsch
Hi Willem,

that was fast! Thanks!

R.,
Thomas

--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-CSV-parser-uses-default-encoding-tp5456136p5466948.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy problem in reading the file

2014-07-18 Thread sergarci
It seems a encodding error or something with the quote to me.
Can I see the code?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-problem-in-reading-the-file-tp5753989p5753998.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Bindy problem in reading the file

2014-07-18 Thread Jaishankar
  }

   public void setLastName(String lastName) {
  this.lastName = lastName ;
   }


}

This is just a sample code which I did.
Anyway Thank you for replying me.
From: sergarci [via Camel] [mailto:ml-node+s465427n575399...@n5.nabble.com]
Sent: Friday, July 18, 2014 5:25 PM
To: Jayashankar C (WT01 - ENU)
Subject: Re: Bindy problem in reading the file

It seems a encodding error or something with the quote to me.
Can I see the code?

If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Bindy-problem-in-reading-the-file-tp5753989p5753998.html
To unsubscribe from Bindy problem in reading the file, click 
here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5753989&code=amF5YXNoYW5rYXIuYzQzQHdpcHJvLmNvbXw1NzUzOTg5fDg0MDQxMzE4Mw==>.
NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com




--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-problem-in-reading-the-file-tp5753989p5753999.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Bindy fixed length - length attribute and truncate

2010-12-21 Thread Claus Ibsen
On Mon, Dec 20, 2010 at 11:33 PM, mikaelfj  wrote:
>
> Hi,
>
> We are using the bindy component to create fixed length value files, version
> 2.4.
>
> My expectations were, that when defining the length of a field using the
> @DataField annotation, then bindy would pad chars if my data was shorter
> than the length (and it does) and that it would truncate my data if it was
> longer than the defined length.
>
> The latter does not seem to happen - and you will end up with a fixed length
> record which is longer than what is defined in the @FixedLengthRecord
> annotation.
>
> Is this somehow by design or is it a bug in the Bindy component?
>

Sounds like a bug. I think by default it should clip the string. We
may need to add an option so you can control/decide what should
happen. Maybe an exception should be thrown instead indicating the
text is too long.

Could you create a JIRA and post a little example? And if possible add
a link to this thread, for example using nabble.


> /Mikael
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-length-attribute-and-truncate-tp3312636p3312636.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: Bindy fixed length - length attribute and truncate

2010-12-21 Thread mikaelfj

I'll add a jira for it - so far we are ensuring the strings are of proper
length before setting them on the annotated class.

I don't think it should be an option not to clip the string.
If an option is added to control clip/no-clip, you are allowing the
generated fixed-length format to be sort of a random-length format - and
recipients of the data, who expects it to be fixed-length, will fail in
receiving the data.

/Mikael
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-fixed-length-length-attribute-and-truncate-tp3312636p3313391.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy fixed length - length attribute and truncate

2010-12-23 Thread Claus Ibsen
Hi

I created a ticket
https://issues.apache.org/jira/browse/CAMEL-3458

And implemented a fix for this.


On Tue, Dec 21, 2010 at 12:49 PM, mikaelfj  wrote:
>
> I'll add a jira for it - so far we are ensuring the strings are of proper
> length before setting them on the annotated class.
>
> I don't think it should be an option not to clip the string.
> If an option is added to control clip/no-clip, you are allowing the
> generated fixed-length format to be sort of a random-length format - and
> recipients of the data, who expects it to be fixed-length, will fail in
> receiving the data.
>
> /Mikael
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-fixed-length-length-attribute-and-truncate-tp3312636p3313391.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



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


Re: Bindy DefaultValue is not working. Need help

2017-05-22 Thread kschroeder
I noticed this issue was only resolved for the CSV Factory.  How would I go
about submitting a similar bug for the FixedLength factory?  It's probably a
bad idea to have inconsistencies between the different factories.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-DefaultValue-is-not-working-Need-help-tp5795402p5800037.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bindy DefaultValue is not working. Need help

2017-05-22 Thread Claus Ibsen
On Mon, May 22, 2017 at 7:44 PM, kschroeder  wrote:
> I noticed this issue was only resolved for the CSV Factory.  How would I go
> about submitting a similar bug for the FixedLength factory?  It's probably a
> bad idea to have inconsistencies between the different factories.
>

You can create a JIRA and submit a fix via github PR
http://camel.apache.org/contributing

>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bindy-DefaultValue-is-not-working-Need-help-tp5795402p5800037.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


  1   2   >