camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dabby11 <>
Subject camel-bindy issue with header and missing locale
Date Tue, 20 Dec 2016 16:01:33 GMT

  I'm developing a route with Camel 2.16.1 that uses Bindy to process a file
with fixed length records. The file consists of a header and many rows.
I'm unmarshalling the stream with the following data format:

BindyFixedLengthDataFormat bindy = new

and my model classes are something like:

@FixedLengthRecord(header = DocumentHeader.class)
public class DocumentRow {

	@DataField(pos = 10, pattern="+000000000.00;-000000000.00", precision = 2,
length = 13, decimalSeparator = ",")
	private BigDecimal value;


public class DocumentHeader {


	@DataField(pos = 365, pattern="+000000000000.00;-000000000000.00",
precision = 2,  length = 16, decimalSeparator = ",")
	private BigDecimal total;



Bindy fails to parse the field with a

It seems the locale specified with bindy.setLocale("default") is not passed
to the inner headerFactory in the BindyFixedLengthDataFormat and Bindy tries
to parse the number calling BigDecimal constructor, instead of parsing it
with DecimalFormat.
Indeed, if I execute the following (ugly!) code before creating the route:

  Field field =
  BindyFixedLengthFactory headerFactory =

to force the locale, everything's fine.

So I think that in BindyFixedLengthDataFormat.createModelFactory() after
headerFactory creation there should be a call to


or something like that (and a similar line for footerFactory).

I checked 2.17.x and 2.18.x branches of and
there's not something like this.

So the question is: is this really an issue with Bindy or should I achieve
this result in a different way ?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message