camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nesrine <>
Subject Store data in elasticsearch using apache camel
Date Sun, 14 May 2017 12:44:59 GMT
Hi I have a complex json string like
I convert this body into map but I can't index into elasticsearch due to
this error 

Caused by: org.apache.camel.TypeConversionException: Error during type
conversion from type: java.lang.String to the required type:
org.elasticsearch.action.index.IndexRequest with value [{id=1, nom=test1},
{id=2, nom=test2... [Body clipped after 1000 chars, total length is 26866]
due java.lang.NullPointerException

How can I resolve this problem ? 
Ps how I convert the body into map : 
String body =exchange.getIn().getBody(String.class);
	    try {
	        TypeFactory typeFactory = mapper.getTypeFactory();
	        CollectionType collectionType =
	                                            List.class, Object.class);
			exchange.getIn().setBody(mapper.readValue(body, collectionType));

	    } catch (IOException e) {

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

View raw message