You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Christian Mueller <ch...@gmail.com> on 2010/05/17 17:26:24 UTC

camel-bindy: not possible to process fix length records without separators?

Hello everybody,

I use Camel 2.2 (the fuse version) and try to process a file which has a fix
length format. This file format doesn't use a separator, because it's not
necessary.
A sample line could looks like:

{code}
4711123456789065432109876543219999999999999999
{code}

4711 is the companyId
1234567890 is the cardProgram
6543210987654321 is the accountNumber
9999999999999999 is the cardNumber

I created a POJO with the Camel bindy annotations:

{code}
@CsvRecord(separator = "")
public class CSVRecord implements Serializable {
	
    @DataField(pos = 1, length = 4)
    private String companyId;
	
    @DataField(pos = 2, length = 10)
    private String cardProgram;

    @DataField(pos = 3, length = 16)
    private String accountNumber;
	
    @DataField(pos = 4, length = 16)
    private String cardNumber;

   // getter and setter
}
{code}

but I received an Exception:
java.lang.IllegalArgumentException: The separator has not been defined in
the annotation @CsvRecord or not instantiated during initModel. must be
specified and not empty

I found no other solution to success my requirements. Any idea?
Or is this a new feature/improvement for Camel Bindy and I should create a
JIRA ticket?

Thanks,
Christian
-- 
View this message in context: http://old.nabble.com/camel-bindy%3A-not-possible-to-process-fix-length-records-without-separators--tp28584909p28584909.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: camel-bindy: not possible to process fix length records without separators?

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Christian,

Processing of Fix Length message is not yet implemented in Camel. From
the example that you show me, you have tried to use CsvBindyFormat
wbich allow to work with CSV format. Don't hesitate to create a ticket
on Apache Camel JIRA to implement this feature.

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 Mon, May 17, 2010 at 5:26 PM, Christian Mueller
<ch...@gmail.com> wrote:
>
> Hello everybody,
>
> I use Camel 2.2 (the fuse version) and try to process a file which has a fix
> length format. This file format doesn't use a separator, because it's not
> necessary.
> A sample line could looks like:
>
> {code}
> 4711123456789065432109876543219999999999999999
> {code}
>
> 4711 is the companyId
> 1234567890 is the cardProgram
> 6543210987654321 is the accountNumber
> 9999999999999999 is the cardNumber
>
> I created a POJO with the Camel bindy annotations:
>
> {code}
> @CsvRecord(separator = "")
> public class CSVRecord implements Serializable {
>
>    @DataField(pos = 1, length = 4)
>    private String companyId;
>
>    @DataField(pos = 2, length = 10)
>    private String cardProgram;
>
>    @DataField(pos = 3, length = 16)
>    private String accountNumber;
>
>    @DataField(pos = 4, length = 16)
>    private String cardNumber;
>
>   // getter and setter
> }
> {code}
>
> but I received an Exception:
> java.lang.IllegalArgumentException: The separator has not been defined in
> the annotation @CsvRecord or not instantiated during initModel. must be
> specified and not empty
>
> I found no other solution to success my requirements. Any idea?
> Or is this a new feature/improvement for Camel Bindy and I should create a
> JIRA ticket?
>
> Thanks,
> Christian
> --
> View this message in context: http://old.nabble.com/camel-bindy%3A-not-possible-to-process-fix-length-records-without-separators--tp28584909p28584909.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
>