Thanks for the pointer.

I added a DBPlaceholderConfigurer and change my filepoller configurations as
below

<file:poller service="dynatest:filePollerSvc"
               endpoint="endpointFP"
               targetService="dynatest:fileSenderSvc">
              
              <property name="marshaler">
                 <bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
              </property>
              <property name="file" value="#{filepolling.incoming.dir}">
              </property>  
  </file:poller> 

  <bean id="propertyConfigurer"
class="com.dynatest.util.DBPlaceholderConfigurer">
        <property name="dataSource" ref="dataSource"/>
  </bean>

  <bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/DynaTest"/>
        <property name="username" value="root"/>
        <property name="password" value="root"/>
  </bean>

I even added timer to execute queries at regular intervals to set the
properties from DB

<bean id="timer"
class="org.springframework.scheduling.timer.TimerFactoryBean">
    <property name="scheduledTimerTasks">
      <bean id="reloadProperties"
class="org.springframework.scheduling.timer.ScheduledTimerTask">
                <property name="period" value="15000"/>
                <property name="runnable">
                  <bean class="com.dynatest.util.ReloadConfigurationsFromDB">
                    <property name="reconfigurableBeans">
                                <ref bean="propertyConfigurer"/>
                    </property>
                  </bean>
                </property>
      </bean>
    </property>
  </bean>

The queries are getting executed, and new properties are getting read and
set whenever i update the table configuration values, but Servicemix doesn't
seem to load the new properties and keeps on polling the original file
directory. Is there some kind of caching being done in Servicemix side..how
can I override that?

regards
Subh


Jean-Baptiste Onofré wrote:
> 
> Hi Subh,
> 
> You can define several File/FTP poller endpoint and inject use a spring 
> PropertyPlaceHolder. You can extend the standard PropertyPlaceHolder to 
> use a database backend.
> 
> Regards
> JB
> 
> subh wrote:
>> I have a requirement to poll different ftp servers with different file
>> paths
>> which changes/updates continuously. I am thinking of writing a generic
>> File/FTP poller and using the file path, ftp server properties etc. from
>> the
>> DB. 
>> 
>> Is there a way I can have these properties injected into my respective
>> servicemix-file and ftp components from DB or do I need to write a custom
>> servicemix bean?
>> 
>> If I write a servicemix-bean, how can I manipulate the polling schedule
>> of
>> these components?
>> 
>> -regards, subh
> 
> 

-- 
View this message in context: 
http://old.nabble.com/File-FTP-poller-configurations-from-database-tp28370233p28379785.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to