[ 
https://issues.apache.org/jira/browse/CAMEL-8797?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Calle Kabo updated CAMEL-8797:
------------------------------
    Attachment: debug.log

In order to eliminate any other errors I stripped out anything unnecessary from 
the camel-context.xml and ended up with this:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
       "
        >

    <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>

    <camel:camelContext xmlns="http://camel.apache.org/schema/spring";
                        id="the.id"
                        streamCache="true">

        <route id="InitialRoute" startupOrder="1001">
            <from 
uri="activemq:queue:ShipmentManagement.FromPartner.FromPartner?acknowledgementModeName=CLIENT_ACKNOWLEDGE&amp;clientId=ShipmentManagement.FromPartner.PartnerShipmentToCanonical"
 />
            <setBody>
                <simple resultType="byte[]">this is the new body</simple>
            </setBody>
            <log message="RECEIVED2, body length = '${in.body.length}'" 
loggingLevel="DEBUG"/>
            <log message="RECEIVED2, body = '${in.body}'" loggingLevel="DEBUG"/>
            <log message="RECEIVED2, body is 
'${in.body.getClass.getCanonicalName}'" loggingLevel="DEBUG"/>

            <to uri="activemq:queue:ShipmentManagement.FromPartner.Canonical"/>
        </route>

    </camel:camelContext>
</beans>
{code}

I still get the exact same output. I'm attaching the debug.log.

> 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
>         Attachments: debug.log
>
>
> 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 
> &#39;java.io.File&#39;</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)

Reply via email to