You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by siddhesh <si...@persistent.co.in> on 2015/12/14 07:09:18 UTC

Issue with ProducerTemplate send. Null value going as String.

Hi All,

I calling send method of ProducerTemplate with my endpoint as follows

producerTemplate.send("abcd:addAttribute?operationName=execute@"+index+"&attributeKey=ERROR_CODE&attributeValue=${property.errorCode}",
exchange);

Later I decided to construct the endpoint uri separately as string as this
template was getting used  many times

producerTemplate.send(constructEndpoint(),exchange);

constructEndpoint(Strign index, String value) {
return
"abcd:addAttribute?operationName=execute@"+index+"&attributeKey=ERROR_CODE&attributeValue="
+ value;

Things starts breaking when property.errorCode is null.  Method
constructEndpoint returns endpoint string with attributeValu as null which
gets evaluated by producerTemplate as String null i.e. "null"

Any idea how to overcome this situation  ?





--
View this message in context: http://camel.465427.n5.nabble.com/Issue-with-ProducerTemplate-send-Null-value-going-as-String-tp5775031.html
Sent from the Camel - Users mailing list archive at Nabble.com.