Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes how the runtime Runtime can be deployed to a cloud environment. When this is done, several points require configuring.

Runtime in the cloud

Set Blueriq license through application.properties

The Blueriq license can be set as a property in your configuration. In your application.properties, add the property blueriq.license with as value the license key:


Code Block

Table of Contents

titleapplication.properties - set license key
blueriq.license=<your license key here>



Table of Contents

Setup configuration in the cloud

Reading the configuration

Out of the box the runtime uses an embedded cloudconfig cloud config server to retrieve the values of property files.
This server reads all property files it finds in the assigned folder, and the runtime asks the server for the value of the property it needs.

If you wish to run the cloud config server on its own, that is also possible. In a cloud environment you want to be sure that all nodes run under the same configuration so that the all show the same behavior. Having a local configuration on each node is difficult to maintain as any change to the configuration should be made to the configuration of each node at the same time. Therefore it is better to lead each node read the configuration from one central position. This is what the spring cloudconfig server can do.

Embedded spring cloud config reading from file system

The spring cloud config server reads its values from the file system (possibly on one central location).

Code Block
titlebootstrap.properties - reading properties from filesystem
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations= file:D:/local-properties

Also see: Reading properties from file system

Embedded spring cloud config reading from Git

To accomplish this, some changes must be made:In the bootstrap.properties you must place the url to reach the server (example:

 It is possible to stop using files on the filesystem, and read property files out of git. This has advantages also the properties are version managed using a standard approach.

To be able to do this, these changes have to be made:


Code Block
titlebootstrap.properties - reading properties from Git
spring.cloud.config.server.git.uri: https://git.blueriq.com/config-repo.git
spring.cloud.config.
uri=http://ipadress:portnumber)
server.git.basedir=target/config
spring.cloud.config.server.git.username=<git_username>
spring.cloud.config.server.git.password=<git_password>
UI Text Box
typenote
Please note that when using GIT the development plugin has limited functionality. As properties can only be read from GIT and not written, the development plugin can only read values and not write them. Any changes made with the development toolbar work during your session, but starting a new session or reloading the application will read the original values from GIT again. This is only an issue for development or test environments, as the development plugin is not present on production environments.

Also read: Reading properties from Git

Creating your own standalone spring cloud config server


To run your own server use the spring-cloud-config-server dependency and @EnableConfigServer. If you set spring.config.name=configserver the app will run on port 8888 and serve data from a sample repository.

You need to have the property spring.cloud.config.server.native.searchLocations to point to the searchlocation, and you need the property:  spring.profiles.active=native to tell the server to not use GIT.

  • Add the following annotation on the standalone config server:
  •  


    Code Block
    @Configuration
    @EnableAutoConfiguration
    @EnableConfigServer
    public class Application {
    
    public static void main(String[] args) {
             SpringApplication.run(ConfigServerApplication.class, args);
             }
    }

    Also see: Reading properties from file system [editor]

    Creating documents

    UI Text Box
    typewarning
    Connecting the Blueriq Runtime to a standalone Config Server requires you to exclude the spring-cloud-config-server.jar from your webapplication. If you do not exclude it, then the embedded server is still used.

    Excluding the embedded server can be achieved by adding the following dependency with exclusion to your custom pom.xml.

    Code Block
    languagexml
    <dependency>
        <groupId>com.blueriq</groupId>
        <artifactId>blueriq-runtime</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-config-server</artifactId>
            </exclusion>
        </exclusions>
    </dependency>


    Creating documents


    When creating documents with the runtime in the cloud, you can not rely on a absolute path to refer to the necessary documents, because the runtime will then search for the documents on the hard drive where the runtime is running.

    This means that the documents folder used by the documents renderer cannot be located in the spring.config.location, instead the property blueriq.documents.base-folder needs to be used.

    We advice to package the documents folder inside the WAR. When doing so the property blueriq.documents.base-folder must be given the value classpath:/. With this value the runtime uses the documents folders inside the WAR.

    To generate a document the runtime uses an IBEX renderer. This renderer requires two adjustments by the customer before being usable.

    (1) No physical paths can be used in a cloud environment. Therefore, the folder containing the xsl files (required to generate documents) must be inside the WAR. To do this you must unpack the WAR and add the folder with the xsl files to the WEB-INF/classes/ folder inside the unpacked WAR and repack the WAR.
    When doing so, the property blueriq.documents.base-folder must be given the value "classpath:/", using this value the runtime uses the documents folders inside the WAR.

    (2) The IBEX renderer also uses windows fonts when creating a pdf-A file. These fonts also should not be read from the file system, as they might be missing on one of the cloud nodes. It is not possible for us to include these fonts due to copyright limitations. ThereforTherefore, it is required for customers to add them to the WAR themselves. To do this the WAR has to be unpacked and the windows fonts should be added to the WEB-INF/classes/ folder inside the unpacked WAR and .

    (3) Finally repack the WAR.

    Usage of exports

    When using the spring cloud config server embedded, all the exports can be placed in the exports folder in the aquima.home folderspring.config.location.
    However if config server is running standalone, these exports must be explicitly named with the full path to each file in the application.properties file.
    Resulting in a line like: blueriq.exports.files=D:\exports\file:///d/exports/example.zip, D:\exports\file:///d/exports/example2.zip, etc.
    These exports must be on the same server as the runtime is running on.

     

    Changes in the future

    We foresee these changes for the future, but can not indicate the version in which they will be released.

    The development plugin cannot write in property files that are read out of GIT. This is something will not be changing. However this results in the fact that the development plugin can only read properties, and this changes its usage. Either the development plugin, or the compatibility with GIT based property storing will be changed.

    Currently static resources are not managed by the spring cloud config server (for example frontend sources and exports). When spring cloud config server manages those as well, they can be versioned using GIT.