camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeff <jflebesc...@gmail.com>
Subject Re: A little problem with annotation @CsvRecord
Date Mon, 25 Feb 2013 19:49:49 GMT
Thanks  @Claus for the help, but it don't works too...

I have found a solution which consist to retrieve the bean from the context
from the routebuilder :

spring bean xml : 
<bean id="cSVLineFormatAED" class="com.myapp...package.CSVLineFormatAED">


@CsvRecord(separator = ";" , crlf = "UNIX")
public class CSVLineFormatAED extends BindyCsvDataFormat {
	public CSVLineFormatAED() {
		super("com.myapp....package");
	}
}

public class BindyRoute extends RouteBuilder {

	@Override
	public void configure() throws Exception {

		// Context Camel
		SpringCamelContext camelCtx = (SpringCamelContext) getContext();

		// Context Spring
		ApplicationContext springCtx = camelCtx.getApplicationContext();

		BindyCsvDataFormat camelDataFormatAED = (BindyCsvDataFormat) springCtx
				.getBean("cSVLineFormatAED");

		from("file:C:/input/test.csv")
				.split(body().tokenize("\n"))
				.unmarshal(camelDataFormatAED)
				.to("mock:test").end();
...
}

Hope it will be helpfull for other developper ! 





--
View this message in context: http://camel.465427.n5.nabble.com/A-little-problem-with-annotation-CsvRecord-tp5728109p5728119.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message