RML

RML Report Engine Left Panel

When generating a RML report, the report by default fills the entire area in the RML Report Engine page. You can enable the parameters on the left of the page. To do so, add the following line in the application.conf file.

ambience.rml-engine.ui-left-parameters = ["application/pdf"]

You can change the pdf to other types if your browser supports viewing them. You can toggle the left panel off by clicking on the corresponding icon.

To toggle on, click on the icon on the top row.

Fonts In RML Reports

You can use extra fonts (non-OS) in the RML reports. To do so, add an extra line in the application.conf file.

ambience.rml.fonts.path = "/<pathname>/Fonts"

Report Job Queue

Ambience/Repertoire stores all state in MongoDB. This means that user can run as many instances as required to scale up the load. A load balancer can be attached on the front to share the web work amongst a number of instances. Other instances can also be used to provide no web services and to provide job engines for handling RML, DocX and ETL loads.

In the example below, Ambience is used. A particular customer needs to run some very slow reports and want to dedicate two engines to slow RML reports.

To do so, perform the following:

  1. Clone an instance of the Ambience server. Let’s name them Server1 and Server2.

  2. For Server1, use the default settings in the application.conf file.

    ambience.queue {
      manager {
        engines : ["first","second"]
        ...
      }
      runners: {
        "docx" : "ambience.docengine.queue,DocXJobRunner"
        "etl" : "ambience.docengine.queue,ETLJobRunner"
        "rml" : "ambience.docengine.queue,RMLJobRunner"
      }
    }
    
  3. For Server2, it is to be used as a server for slow reports. Edit the following:

    ambience.queue {
      manager {
        engines : ["third","fourth"]
        ...
      }
      runners: {
        "rml-slow" : "ambience.docengine.queue,RMLJobRunner"
      }
    }
    
  4. If the Server2 is not serving web pages, add the following line:

    ambience.web.bind-enabled = false
    
  5. Run both servers. Server2 handles only “rml-slow” job types while Server1 handles “rml”, docx“ and ”etl" job types. Do note that these are job types, not job queue.

There is still only one queue (see JobQueue in MongoDB) but different instances are configured to recognise different items in the queue.

An engine that handles only “rml-slow” will ignores anything earlier in the queue and only pull out the first “rml-slow” request for handling.

  1. Add the desired job types (in this case, “rml” and “rml-slow”) and job priorities in the RML report as parameters in the Designer.

Two choices are provided to match the names of the two job types. Save the RML and render the modified RML in the Repository module in Ambience.

If “rml” is chosen, the main “web” server (Server1) will render the report. If “rml-slow” is chosen, then the slow server (Server2) will render the report.

  1. Run the report using “rml-slow”. From the JobQueue collection, the “third” engine is selected to run the report.

Either MongoDB or Developer module can be used to view the JobQueue collection. If you are unable to view the “ambience” database, add the following line in the “application.conf” file to enable it:

ambience.developer.ambience-mode = true
  1. You may notice that running RML in “rml-slow” it may take a while longer to reply than if “rml” is used, even if it is the same report.

If It is run as “rml”, then it might not appear in the JobQueue at all.

These two obeservations are linked. The “web” server has some special “bypass” logic, which calls for the job when an engine is free, regardless of the queue. These items may not appear in the JobQueue and will provide a fast, interactive return. However, if all engines are busy, the request will be queued.

Queued requests are slightly slower because of the overheads of submitting and retrieving jobs from the queue. For long reports, which can take tens of minutes, a second or two is negligible, which is why “rml-slow” is put on the non-web server where there is no bypass logic to avoid the queuing.

  1. Job priority can also be set for the RML just as job type is defined in the Designer.

When an engine is looking for work, it will sort the eligible jobs (i.e., those with a jobType it understands) by:

  • “jobPriority”

  • “expireAt” time (derived from when it was added to the queue)

In other words, with three priority 5 reports, the earliest added would be chosen, but any priority 1 report would be done first.

In the example above, user chooses between 1, 3, 5, 7, 9 with default being 5. The JobQueue shows the selected value.

If no value is chosen, the default will be used. In this case “5” is used. If a value is to be specified, then “1” is the first (highest) priority. There is no limit on the number, a value of “100” can be set for a very low priority job, for example.

  1. The values of these parameters can be passed as part of the URL if it is calling from the server from outside. Below is an example:
    elx-jobType=rml-slow&elx-jobPriority=7
    

Configure Large Report Chunk

Some reports are large (e.g., over 100k), which can congest the queue during rendering. To prevent the queue from becoming overloaded, writing the report to a designated location can help alleviate the strain.

To configure large report chunk to a S3 or hard disk location, add the following in the application.conf file:

ambience.rml-engine {
  default-timeout : 60 seconds
  large-chunk-size : 100K
  large-chunk-location : "xx-aws"
  large-chunk-expiry = 10 minutes
}

Change the location to large-chunk-location : “xx-hd” to write to a hard disk location.