Gert, Thanks for the reply, this helps with the direction I need to go. I knocked together a quick test based on what you said but get a
Unrecognized xbean element mapping: defaultFileMarshaler in namespace http://servicemix.apache.org/config/1.0 when deploying I have the following <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0" xmlns:bt-prototype="http://uk.co.lbi/bt-prototype" xmlns:sm="http://servicemix.apache.org/config/1.0" > <ftp:sender service="bt-prototype:moveSender" endpoint="endpoint" uri="ftp://chris:t...@localhost/"> <ftp:marshaler> <sm:defaultFileMarshaler> <sm:fileName> <sm:xpathString xpath="concat('test','.xml')"/> </sm:fileName> </sm:defaultFileMarshaler> </ftp:marshaler> </ftp:sender> </beans> Am I doing something stupid, missing something out or deploying wrongly. Again any help will be gratefully recieved Regards Chris Gert Vanthienen wrote: > > Chris, > > You can configure the file name on the FTP endpoint the same way as you > can with the servicemix-file component. If you look at the first > marshaler example on http://servicemix.apache.org/servicemix-file.html, > you can use the same thing for ftp (just use ftp:marshaler instead of > file:marshaler). > > The example uses a message property to determine the name, but you can > also use an XPath expresssion to look inside your XML message and grab > some information there to make up the file name. > > For the conversion to mail, are you using the servicemix-mail component > or the camel-mail one? For the servicemix-mail component, you can write > your own Marshaler class that allows you to 'translate' the JBI message > into a mail message. > > Regards, > > Gert > > chriskee wrote: >> I am currently learning how to use servicemix and not sure how I would >> achieve the following. >> >> I have a message placed on a JMS Queue and want to post a message to a >> defined email address than a message has been recieved. I also then want >> to >> ftp this message as a simple file. I am able to pull this message off >> the >> JMS queue and do things with it as long as all it is a XML message. The >> problem I have is when I want to convert to something else such as a >> email >> or a file to FTP. >> >> I had intended to write a JMS consumer and then pass to an EIP component >> which then delivered it to both the ftp and email components. When I try >> sending the message as ftp I get a >> >> java.io.IOException: No output stream available for output name: null. >> Maybe >> the file already exists? >> >> I assume this is because I never had a filename from the begining as I am >> working with a XML message rather than a file that's been read in. For >> example if I switch to a File poller and can then FTP fine. My question >> is >> what approach should I use to take a XML message from a queue convert it >> to >> a file to ftp and then also how to convert to send via email. >> >> Any help, no matter how small is gratefully recieved >> >> Thanks >> Chris >> > > > > ----- > --- > Gert Vanthienen > http://gertvanthienen.blogspot.com > -- View this message in context: http://www.nabble.com/Approach-to-use-for-XML-to-FTP-and-XML-to-Email-tp21667383p21684695.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
