camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DEPREZ Arnaud AWL-IT" <>
Subject RE: Naming your file with
Date Tue, 04 Sep 2012 12:38:39 GMT
I don't see where you call the method sendTo(...).
If you don't call it, Camel will put the Exchange ID as the name of your file.

Arnaud Deprez
Acquiring Back-Office
+32 2 727 72 09
Chaussee de Haecht 1442 Haachtsesteenweg
1130 Brussels

 please don't print unless you really need to

-----Original Message-----
From: Saurabh []
Sent: mardi 4 septembre 2012 13:42
Subject: Re: Naming your file with

Hi Friends,

I am working on a small spike in which my task is to pick an xml from a
directory, put it on jms queue and save the xml to some other directory.

This is the code snapshot, this is after I converted the file contents in to
a string.

private static final String URI = "activemq://queue:test.MyQueue"  ;

protected void sendTo(String uri,String message) throws Exception {
                ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
                Exchange exchange = new DefaultExchange(camelContext,
                Message camelMessage = exchange.getIn();
                camelMessage.setHeader(Exchange.FILE_NAME, "testmesage");

                producerTemplate.send(uri, exchange);

and camel route is
        <from uri="jms:test.MyQueue"/>
        <to uri="file://target/test?noop=true/>

The file appears in target but with name

and not "testmessage" as I specified.

hope I am clear
Please help

Thanks in advance

View this message in context:
Sent from the Camel - Users mailing list archive at

Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

"The information contained in this e-mail and any attachment thereto is confidential and may
contain information which is protected by intellectual property rights.
This information is intended for the exclusive use of the recipient(s) named above.
This e-mail does not constitute any binding relationship or offer toward any of the addressees.
If you are not one of the addressees , one of their employees or a proxy holder entitled to
hand over this message to the addressee(s), any use of the information contained herein (e.g.
reproduction, divulgation, communication or distribution,...) is prohibited.
If you have received this message in error, please notify the sender and destroy it immediately
The integrity and security of this message cannot be guaranteed and it may be subject to data
corruption, interception and unauthorized amendment, for which we accept no liability."
View raw message