[ 
https://issues.apache.org/jira/browse/CAMEL-22352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-22352.
---------------------------------
    Resolution: Fixed

> camel-main: DataFormat auto configuration does not work
> -------------------------------------------------------
>
>                 Key: CAMEL-22352
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22352
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-main
>            Reporter: James Netherton
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.15.0
>
>         Attachments: camel-main-csv.zip
>
>
> Not sure if I miss something obvious, but I don't see data format auto 
> configuration being applied correctly when using camel-main.
> I attached a reproducer with camel-csv, where application.properties has 
> camel.dataformat.csv.ignore-surrounding-spaces = true. The result from the 
> unmarshal should be:
> {code:java}
> [[One], [Two], [Three]]
> {code}
> But it shows as the following, because the ignore-surrounding-spaces is not 
> applied:
> {code:java}
> [[One   ], [Two   ], [Three]]
> {code}
> I see the DataFormat get instantiated twice. First here:
> [https://github.com/apache/camel/blob/9d8cf83bc93c80017b270072ba74ffc898e96531/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java#L2512]
> The property binding is done against that instance.
> But later the DataFormat ends up being created again here:
> [https://github.com/apache/camel/blob/main/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/dataformat/DataFormatReifier.java#L111]
> No property binding is done against this instance, effectively ignoring the 
> auto configuration.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to