camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-3562) BindyFixedLengthDataFormat does a trim on Fixed Length record
Date Fri, 21 Jan 2011 05:23:45 GMT


Claus Ibsen commented on CAMEL-3562:

Ashwin sorry I was maybe a bit to jumpy. 15 min after I turned off the computer I kinda thought
of this again.

The trimming is when you unmarshal, suppose we have this record format (I use dash as space
in this example)


Then when I unmarshal to a pojo having
- String firstName
- String lastName
- int id

I would like it to be mapped as
- firstName = "Claus"
- lastName = "Ibsen"
- id = 1234

eg the data is trimmed.

Now with the new {{trim}} or {{trimOnUnmarshal}} option set to false I would get

- firstName = "Claus-------------"
- lastName = "Ibsen--------------"
- id = 1234

And frankly this last situation is not what you want by default. So I think we should switch
back and have {{trim}} set to {{true}} as you did in the first place.

> BindyFixedLengthDataFormat does a trim on Fixed Length record
> -------------------------------------------------------------
>                 Key: CAMEL-3562
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-bindy
>    Affects Versions: 2.4.0
>            Reporter: Ashwin Karpe
>            Assignee: Ashwin Karpe
>             Fix For: 2.6.0
>         Attachments: CAMEL-3562.patch, UPD-CAMEL-3562.patch
> BindyFixedLengthDataFormat does a trim on Fixed Length record, although Fixed Length
recordare strictly positional in nature and may contain lot of fillers with empty spaces,
doing a trim causes Bindy to fail the message length validation and exception is thrown on
message length 
> // Read the line 
> String line = scanner.nextLine().trim(); 
> Should be changed to 
> // Read the line 
> String line = scanner.nextLine(); 
> Or a conditional option should be provided in FixedLengthRecord annotation whether or
not to trim the entire record

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message