On Wed, Apr 11, 2012 at 1:38 AM, icemanltd <[email protected]> wrote:
> I am expecting rather large files so I would prefer to receive a FileMessage
> from my file components. After reading the documentation I thought this was
> the default behavior but the following route is sending a JmsMessage with
> the file content as the body. (using Camel 2.8.3 in ServiceMix 4.4.0)
> What am I doing wrong?
>

That is expected. When sending a JMS message, Camel will know its a
java.io.File handle as the message body, and then load the content of
the file and send it over.

What you can to do is to transform the message to a file name, if that
is all you want to send over JMS. So the receiver just get a name of
the file.

<transform>
  <simple>${file:name}</simple>
</transform>
<to uri="activemq:...."/>


> <blueprint
>    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0";
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>    xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>
> http://camel.apache.org/schema/blueprint/camel-blueprint-2.8.3.xsd
>                        http://www.springframework.org/schema/osgi
>
> http://www.springframework.org/schema/osgi/spring-osgi.xsd";>
>
>    <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
>        <route id="C001FileMonitor">
>            <description>Monitors client directory for files</description>
>
>            <from uri="file:///c:/temp/shared_storage_root/C001/landing"/>
>            <to
> uri="activemq:queue:FLMP.Activity.NewFile?mapJmsMessage=false&jmsMessageType=Object"
> />
>            <log message="Recieved ${in.body}"/>
>        </route>
>    </camelContext>
>
>
>    <reference id="connectionFactory"
>               interface="javax.jms.ConnectionFactory" />
>
>    <bean id="activemq"
>          class="org.apache.activemq.camel.component.ActiveMQComponent">
>        <property name="connectionFactory" ref="connectionFactory" />
>    </bean>
> </blueprint>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FileComponent-not-producing-FileMessage-tp5631434p5631434.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to