Description

The RESTDirectoryV2Receiver traverses one or more payload sub-directories and for each file found it creates request headers and payload, passes generated data to the given target and upon receiving a response, stores the response payload to a file. This Receiver requires an XML configuration file to read request URL and header metadata in order to create request headers. 


Parameters

The following parameters can be defined for the RESTDirectoryV2Receiver. Items with an asterisk (*) are required.  

  • payloadFilesPath* - Defines the base location of the files to send. 
  • payloadFilesSubDir* - Defines the naming convention for sub-directories within the payloadFilesPath.
  • configFilePath* - Defines the location of the configuration file.
  • configFileSubDir - Defines the sub-directory within the config directory. 
  • configFileName* - Defines the name of the configuration file.
  • configTag* - Defines the tag that needs to be matched from the list of configurations defined in the file.
  • requestContentType* - Defines the HTTP content type for the request:
    • ANY, TEXT, JSON, XML, HTML, URLENC, BINARY
  • responseContentType* - Defines the HTTP content type for the response:
    • ANY, TEXT, JSON, XML, HTML, URLENC, BINARY
  • responseOutput* - Defines if an output response file should be produced and if so, how it should be produced.
  • responseFilePath - Defines the location where the response file will be saved.
  • responseFileSubDir - Defines the sub-directory within the response directory where the response file will be created.
  • responseFileName - Defines the name of the Response file.
  • logRequestCount* - Defines the number of requests that are executed before logging a message to the console.
  • threadCount* - Defines the number of requests that may be sent simultaneously.
  • scriptFilePath - Defines the path where the script file will be located. A script can be executed after receiving the response to take further actions.
  • scriptFileSubDir - Defines the sub-directory within the script directory. 
  • scriptFileName - Defines the name of the script to be executed.


Configuration File

The RESTDirectoryV2Receiver must read from a configuration file to attain the request URL and other request header information.


The format of the configuration file is as follows:


<configs>
  <commonHeaders>
    <header type="timeStamp" format="yyyyMMdd" name="Accept-Datetime"/>
    <header type="UUID" name="If-Match"/>
    <header type="static" name="x-auth">n4vdslor8dnx0ghlnbg34rcn96bf</header>
  </commonHeaders>

  <config tag="organization">
    https://abc.com/organization
    <headers>
      <header type="static" name="header1">value1</header>
      <header type="static" name="header2">value2</header>
    </headers>
  </config>

  <config tag="brand">
    <parameter filePath="#{resource.output.directory}" fileName="org.props"/>
    https://abc.com/brand/#{ORG_ID}
    <headers>
      <header type="static" name="header3">value3</header>
    </headers>
  </config>

  <config tag="store">
    <parameter filePath="#{resource.output.directory}" fileName="brand.props"/>
    https://abc.com/store/#{BRAND_ID}
    <headers>
      <header type="static" name="header4">value4</header>
      <header type="static" name="header5">value5</header>
    </headers>
  </config>

</configs>



XML