[
https://issues.apache.org/jira/browse/CAMEL-8797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560510#comment-14560510
]
Calle Kabo commented on CAMEL-8797:
-----------------------------------
Perhaps I should have mentioned that the input was a ActiveMQBytesMessage.
Could ActiveMQBytesMessage end up as a read once, thus in need of stream
caching?
> 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)