camel-bindy @DataFeild trim parameter does not affect to the last column in the csv line

Solution Verified - Updated -

Issue

This is the Java Bean with @CsvRecord(separator = ",").
Please note that all of @DataField has trim=false.

    @DataField(pos = 1, trim = false)
    private String orderNr;

    @DataField(pos = 2, trim = false)
    private String clientNr;

This is the toString() method.

    @Override
    public String toString() {
        return "Order:" + this.orderNr + ":" + this.clientNr +";";
    }  

By executing this camel route here,

  from("timer://foo?repeatCount=1")
.setBody(constant("a  ,b  \n"))
.unmarshal(camelDataFormat)
.log("${body}");

expected result is

Order:a  :b  ;

but the actual result is

Order:a  :b;

Environment

  • Red Hat Fuse
    • 7.12
  • Camel for Spring Boot
    • 3.20

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content