TheKidCof,

In the previous example, the file was copied from one FTP location (referred to by <ftp:poller/>) to another (the <ftp:sender/>)

If you want to store the files in a local directory, you'll have to create a second SU, using servicemix-file. Create the zip file (my-file-su.zip) which contains an xbean.xml file like this
<beans xmlns:file="http://servicemix.apache.org/file/1.0";
      xmlns:my="http://my.own/smx";>

   <file:sender service="my:file-sender" endpoint="endpoint"
       uri="..." />

</beans>

Add my-file-su.zip to your service assembly and update META-INF/jbi.xml to reflect 
the additional SU, adding this <service-unit/> block:
<service-unit>
   <identification>
       <name>my-su</name>
       <description>My First :: File Service Unit</description>
   </identification>
   <target>
       <artifacts-zip>my-file-su.zip</artifacts-zip>
       <component-name>servicemix-file</component-name>
   </target>
</service-unit>

Now, you can change the targetService and targetEndpoint attribute of the 
<ftp:poller/> element to connect it to your <file:sender/> to finish up your 
configuration.

Is this the information you were looking for?

Regards,

Gert



Thekidcof wrote:
Hey Gert,

       Thank you so much for your help. It worked, however where does it
copy the file to? I want the FTP component to copy a text file to directory
of my choosing. How do i get the xbean to configured to ftp the file to the
folder of my choice?

If you could help me out that would be great.

TheKidCof

Gert Vanthienen wrote:
TheKidcof,


First, create a zip file (my-su.zip) which contains the xbean.xml file with your configuration, something like this:
<beans xmlns:ftp="http://servicemix.apache.org/ftp/1.0";
              xmlns:my="http://my.own/smx";>

    <ftp:poller service="my:poller" endpoint="endpoint"
        targetService="my:sender" targetEndpoint="endpoint"
        uri="..." />

    <ftp:sender service="my:sender" endpoint="endpoint"
        uri="..." />

</beans>

Next, create a zip file (my-sa.zip) which contains the previous ZIP file and META-INF/jbi.xml:
<jbi xmlns="http://java.sun.com/xml/ns/jbi"; version="1.0">
    <service-assembly>
        <identification>
            <name>my-sa</name>
            <description>My First :: SA</description>
        </identification>
        <service-unit>
            <identification>
                <name>my-su</name>
                <description>My First :: FTP Service Unit</description>
            </identification>
            <target>
                <artifacts-zip>my-su.zip</artifacts-zip>
                <component-name>servicemix-ftp</component-name>
            </target>
        </service-unit>
    </service-assembly>
</jbi>

Now, install the servicemix-ftp component (just copy the installer zip you find in /components to /deploy) and any required components. If everything is OK, just copy the my-sa.zip to the /deploy directory and you should be up and running.

Hope this helps,

Gert


Thekidcof wrote:
Can anyone help me out. I have installed the servicemix-FTP component
however, when I try to run the example
(http://incubator.apache.org/servicemix/servicemix-ftp.html) using
xbean.xml
it doesn't work. What are the steps to creating\configuring\deploying an
Xbean.xml file for the service mix-FTP component? The steps on the above
mentioned link aren't detailed enough for me.

I am new to service mix therefore anyhelp would be greatly appreciated.

TheKidcof


Reply via email to