Skip to content

Wrapper configuration

Jean-Paul Calbimonte edited this page Nov 6, 2013 · 1 revision

Morph-web can host live data streams that feed from different sources through wrappers. We show here how to configure them.

wrappers.conf

In conf/wrappers.conf you can find the wrappers configuration. For each wrapper there is an entry as the following:

social {
  sourcetype=csv
  engineurl="akka://esperkernel/user/EsperEngine"
...
}

In this example the wrapper is named social and is fed by a csv file. Other wrapper types are: restapi (fed by REST api calls returning either json or xml) and random (fed by synthetic data streams). The engineurl is the Akka address of the Esper engine.

Main configuration fields:

If in doubt, cop-paste from the exaples.

  • rate: rate at which the wrapper feeds the stream.
  • outputstream name of the stream.
  • fields: list of field names of the stream.
  • types list of field data types.

Csv specific:

  • rowrate: rate at which each row is generated (the rate parameter may group several rows).
  • url: location of the csv
  • servicefields: csv column names

Random specific:

  • generator: range of rows to generate, e.g. 0,10 generates 10 rows.

Rest Api specific:

  • url: location of the service
  • servicefields: service result data paths: e.g. main/temp
  • serviceroot: path of the list of elements to iterate over.

Start the wrapper in Morph-web

Put the following line in Global.scala onStart method:

    new ApiWrapper("weathermap",esper.system)