Just "thinking" ...

from("jms:...")                                            // 1
  .setHeader("CamelFileName", xpath("/Payload/FileName"))  // 2
  .setHeader("OrderId", xpath("/Payload/OrderId"))         // 3
  .to("xslt:transformPayloadToTextfile.xsl")               // 4
  .to("ftp:user@server?password=secret")                   // 5
  .to("velocity:successTemplate.vm")                       // 6
  .to("jms:...")                                           // 7

1+7: see http://camel.apache.org/jms.html
2+3: store part of the body as header for later reuse
2: special header which is used for file name
4: use xslt for just extracting the body
5: upload the data; havent found examples or documentation of using ftp as 
consumer at http://camel.apache.org/ftp2.html
6: create the success message using a velocity makro; access to exchange 
headers ("OrderId") is possible


Jan



> -----Ursprüngliche Nachricht-----
> Von: Radhakrishna Kalyan [mailto:nrkkal...@gmail.com]
> Gesendet: Montag, 18. August 2014 12:48
> An: users@camel.apache.org
> Betreff: Need help
> 
> Hi,
> 
> I have a requirement where I have to download a xml file from a jms
> queue and upload only a specific part of that xml file to a ftp server
> and finally send a status message to a different jms queue.
> 
> i.e my jms message may have the following structure.
> 
> <Payload>
>     <*OrderId*>123</*OrderId*>
>     <*FileName*>abc.txt</*FileName*>
>     <*Body*>bla bla bla</*Body*>
> </Payload>
> 
> All I want is to download the xml message from JMS queue and then
> unmarshal that xml and create a text file only with the contents
> between <*Body*> tag of xml.
> The file shall be named what ever given in <*FileName*> tag.
> 
> If the text file is uploaded successfully then I want to send a
> "*Success*"
> message to a different JMS queue along with the value from <*OrderId*>
> tag.
> If any exception occurred during the above process, then I want to send
> a
> *"Failed"* message and exception message and the <OrderId> to the Jms
> queue.
> 
> Correct me if I am wrong, I think I need to create 3 endpoints 2 for
> jms queues and 1 for ftp.
> I am struck at, do I need a DataFormat or a Processor or any thing
> else.
> Can somebody give me some pointers here.
> 
> Thanks in advance.
> 
> --
> Thanks and Regards
> N Radhakrishna Kalyan
> 
> P:  +46 733 312 584
> http://about.me/nrkkalyan
>  <http://about.me/nrkkalyan>

Reply via email to