As described here, and in the official documentation itself: the unwrapSingleInstance
property allows us to establish "when unmarshalling should a single instance be unwrapped and returned instead of wrapped in a java.util.List".
However, the camel.dataformat.bindy-csv.unwrap-single-instance
auto-configuration property of Spring Boot has no effect on the documentation example:
BindyCsvDataFormat bindy = new BindyCsvDataFormat(com.acme.model.MyModel.class);
from("file://inbox")
.unmarshal(bindy)
.to("direct:handleOrders");
The above example only works by setting the property this way, directly in the code:
bindy.setUnwrapSingleInstance(false);
I guess this is because the new BindyCsvDataFormat
object is not managed by Spring, so how can I get Spring to create and manage it for auto-configuration to take effect in Apache Camel?
I tried to create a regular bean in Spring and set the reference in unmarshal
, and auto-configuration has no effect either:
@Bean
public DataFormat bindyCsvDataFormat() {
return new BindyCsvDataFormat(com.acme.model.MyModel.class);
}
from("file://inbox")
.unmarshal("bindyCsvDataFormat")
.to("direct:handleOrders");
I have this dependency in pom.xml
with Apache Camel version 3.20.5
:
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-bindy-starter</artifactId>
</dependency>