[
https://issues.apache.org/jira/browse/CAMEL-8797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560555#comment-14560555
]
Calle Kabo edited comment on CAMEL-8797 at 5/27/15 7:27 AM:
------------------------------------------------------------
I was thinking the exact same thing :)
But is it possible to get to that function using simple? Something like
{code}
${in.getBodyLength}
{code}
? Only that doesn't seem to work...
was (Author: emancalle):
I was thinking the exact same thing :)
But is it possible to get to that function using simple? Something like
${in.getBodyLength}? Only that doesn't seem to work...
> byte array length is not correct in simple
> ------------------------------------------
>
> Key: CAMEL-8797
> URL: https://issues.apache.org/jira/browse/CAMEL-8797
> Project: Camel
> Issue Type: Bug
> Reporter: Calle Kabo
> Assignee: Claus Ibsen
>
> I have a byte[] containing an XML.
> {code}
> <log message="Body is '${in.body.getClass.getCanonicalName}'"
> loggingLevel="DEBUG"/>
> <log message="Body = '${in.body}'" loggingLevel="DEBUG"/>
> <choice>
> <when>
> <simple>${in.body} is
> 'java.io.File'</simple>
> <setHeader
> headerName="CamelAwsS3ContentLength">
> <simple>${file:size}</simple>
> </setHeader>
> </when>
> <otherwise>
> <setHeader
> headerName="CamelAwsS3ContentLength">
> <simple>${in.body.length}</simple>
> </setHeader>
> </otherwise>
> </choice>
> <log message="Body length = ${in.header.CamelAwsS3ContentLength}"
> loggingLevel="DEBUG"/>
> {code}
> The above code outputs the following in the logs:
> {code}
> Body is 'byte[]'
> Body = '<?xml version="1.0" encoding="ISO-8859-1"?><root> /... bla bla bla
> .../ </root>'
> Body length = 1
> {code}
> Using Camel 2.14.0.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)