Ambience 2023 Queue Strategies

The main purpose of the queue strategy in Ambience 2023 is to enable users to run and configure as many Ambience instances to scale up the load as necessary.

In this example, we are using 2 different Ambience servers. 1 server would handle the normal reports while the other server would handle the large reports. The server handling the large reports will also be running in headless mode.

  • Ambience-2023-Server1 (handles normal reports)
  • Ambience-2023-Server2 (handles large reports)

1/ In the etc/application.conf file of the second server (i.e. Ambience-2023-Server2), navigate to the ambience.queue node and revise the values as such.

2/ Next, at the end of the application.conf file, add the following one-liner config.
*This would tell the system that this server is not serving web pages.

  • However, if you wish to have 2 web servers, leave the above configuration enabled → revise the port number → set-up a load balancer to share the load between the 2 servers.

3/ Once done, save the etc/application.conf file.

4/ The values in the first server (i.e. Ambience-2023-Server1) remains by default in this example.

4/ Next, start up both the servers. If successful, you should see the following log snippet in the specific server’s ambience logs.

5/ To test out the queue strategy, add the following parameter at the rml template via the designer:

6/ Save the rml template and try rendering it.

  • If “rml” is chosen, the rendering process would be handled by the first server. If “rml-slow” is chosen, the rendering process would be handled by the second server.
  • Apart from the designer, you may also wish to test it out by rendering from the Repository module itself.
  • In the repository, the field label would automatically be revised to “Job Type” instead.
  • To confirm from the MongoDB logs, do refer to the JobQueue collection.

7/ Else, you may configure the parameter in an API call. An example of a curl call as such:

curl -v -X POST http://localhost:1740/rml-engine/render?elx.token=f00xxx486a-96aa-1f3xxxc2 -H “Content-Type: application/json” -d “{"elx-jobType":"rml-large", "rml":"/ElixirSamples/Report/RML/Map.rml", "renderDetails": { "RenderAsImage": "Yes", "AllowScreenReaders": "No"}}” -o result.pdf