Hi.
If you want that your ftp poller component sends file to the fileSender
component, you must specify, as destination service of the ftp
component, the fileSender service and not "foo:receiver' which not exist.
<sm:activationSpec componentName="ftpPoller"
service="foo:ftpPoller"
destinationService="*foo:fileSender*">
Glenn Murray wrote:
Hi,
I am trying to evaluate ServiceMix as a data integration tool in a
scientific laboratory. We need to poll remote directories for output
files. For now I'm trying to fetch text files.
I set up an ftp server (Linux, wu-ftpd) which I can access from the
command line and Firefox. The test-user account has test-file.xml and
test.txt files. The http://servicemix.org/site/ftp.html page inspired
the xml below, but a lot of it is guesswork from looking at the
file-binding example. I haven't changed any Java code.
When I run it I get the message below, and then nothing happens.
Please note that I am a complete newbie to ServiceMix, so I'm probably
missing something very obvious (e.g., it's not clear to me if I need
to hook the poller into the writer somehow).
Thanks much for your help!
Glenn
ftp-GM/$ ../../bin/servicemix ftp-servicemix.xml
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)
Apache ServiceMix ESB: 3.0-M2-incubating
Loading Apache ServiceMix from file: ftp-servicemix.xml
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=#SubscriptionManager#] with service: null
component: [EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component:
#SubscriptionManager#
INFO - DeploymentService - Restoring service assemblies
INFO - JBIContainer - ServiceMix JBI Container
(http://servicemix.org/) name: ServiceMix running version: 3.0-M2-incubating
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=ftpPoller] with service:
{http://servicemix.org/demo/}ftpPoller component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component: ftpPoller
INFO - JBIContainer - Activating component for:
[container=ServiceMix,name=fileSender] with service:
{http://servicemix.org/demo/}fileSender component:
[EMAIL PROTECTED]
INFO - ComponentMBeanImpl - Initializing component: fileSender
<?xml version="1.0" encoding="UTF-8"?>
<!-- GM ftp e.g. -->
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:foo="http://servicemix.org/demo/">
<!-- the JBI container -->
<sm:container id="jbi"
useMBeanServer="true"
createMBeanServer="true"
dumpStats="true"
statsInterval="10">
<sm:activationSpecs>
<!-- Poll for files -->
<sm:activationSpec componentName="ftpPoller"
service="foo:ftpPoller"
destinationService="foo:receiver">
<sm:component>
<bean class="org.apache.servicemix.components.net.FTPPoller">
<property name="clientPool">
<bean id="ftpClientPool"
class="org.apache.servicemix.components.net.FTPClientPool">
<!-- property name="host" value="localhost"/-->
<property name="host" value="192.174.39.126"/>
<property name="username" value="test_user"/>
<property name="password" value="testpasswd"/>
</bean>
</property>
<property name="workManager" ref="workManager"/>
<!-- <property name="path" value="foo"/> -->
<property name="period" value="1000"/>
</bean>
</sm:component>
</sm:activationSpec>
<!-- Write files to the outbox directory -->
<sm:activationSpec componentName="fileSender"
service="foo:fileSender">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="org.apache.servicemix.components.file.FileWriter">
<property name="directory" value="outbox" />
<property name="marshaler">
<bean
class="org.apache.servicemix.components.util.DefaultFileMarshaler">
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
<!-- the work manager (thread pool) for this container -->
<bean id="workManager"
class="org.jencks.factory.WorkManagerFactoryBean">
<property name="threadPoolSize" value="30" />
</bean>
</beans>