XmlBlaster Logo

REQUIREMENT

contrib.filewriter

XmlBlaster Logo


Type NEW
Priority HIGH
Status CLOSED
Topic You can receive messages published by the filewatcher and store them at a certain location on the filesystem.
Des
cription

This can either be run as a java plugin running locally on the server, or a c++ standalone application. For the standalone application this is to be found under the demos as FileWriterApp. The configuration parameters are the same for both solutions.

Example
any

Invoke the c++ Client

You can easlily invoke the c++ client by going to the demo/bin Directory (or pointing the classpath to it) and invoke:

 FileWriterApp -propertyFile xmlBlaster.properties
Configure

The plugin is configured in the xmlBlasterPlugins.xml configuration file. Here an example where all properties are used:


  <xmlBlaster>
    ...
     <plugin create='true' id='FileWriter' className='org.xmlBlaster.contrib.filewriter.FileWriter'>
        <attribute id='mom.administered'>true</attribute>
        <attribute id='mom.loginName'>writer01/1</attribute>
        <attribute id='mom.password'>secret</attribute>
        <attribute id='filewriter.directoryName'>${user.home}/writerDirName</attribute>
        <attribute id='filewriter.tmpDirectoryName'>${user.home}/writerDirName/tmp</attribute>
        <attribute id='filewriter.overwrite'>true</attribute>
        <attribute id='filewriter.lockExtention'>.lck</attribute>
        <action do='LOAD' onStartupRunlevel='7' sequence='4' onFail='resource.configuration.pluginFailed'/>
        <action do='STOP' onShutdownRunlevel='6' sequence='6'/>
     </plugin>
   ...
 </xmlBlaster>

and here a more detailed description about each attribute:
id (name) type default value Comment
mom.connectQos String null optional: In case you need special considerations when connecting, you must specify this in this connectQos. If you specify something here, the mom.loginName is ignored. Note that you need to specify one of these two.
mom.loginName String ${user.name} optional: The name to be used to login. You can specify also a session name for example someName/1 to force it to use a positive sessionId. If you specified mom.connectQos this parameter is ignored.
mom.password String null optional: The password to use to login to xmlBlaster.
mom.administered String false optional: if you want to use this file writer as part of a file replication, you want to administer/monitor the workflow with the replication monitor. To enable this you must specify true here. Setting this value to true will result in mom.subscribeKey and mom.subscribeQos to be ignored, since the subscription will first be done by the administrator via the replication monitor. If you do not choose true here, you will not be able to use the replication monitor.
mom.subscribeKey String null optional: if you specified mom.administered or mom.topicName you do not specify anything here. If you however want to subscribe direct when starting the application and need some special attributes in the key you can specify it here. Note that if you
mom.topicName String null optional: The topic to which to subscribe. You only need to specify something if you did not set mom.administered and did not specify a mom.subscribeKey.
dom.subscribeQos String null optional: The Qos to use when/if subscribing. You can specify here the stuff if you need additional info to be passed to the subscription. It only has effect if you did not set mom.administered.
filewriter.directoryName String null mandatory: The directory where to store the received files.
filewriter.dmpDirectoryName String ${filewriter.directoryName}/tmp optional: The directory where the received chunks are stored before recomposing the entire file (after the file is completed these chunks are deleted).
filedriter.overwrite String true optional: when this is set, an arriving file will overwrite an existing one even if a file with the same name already exists.
filewriter.lockExtention String null optional: if set to true, a lock file is first written before starting to store the file. This can be used by an other application using these files, to determine if the file is not completely built yet. Once the file has been completed, this lock file is removed from the file system.

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

See REQ engine.runlevel
See TEST org.xmlBlaster.test.contrib.TestFileWriter

This page is generated from the requirement XML file xmlBlaster/doc/requirements/contrib.filewriter.xml

Back to overview