Skip to content

Configuring Extension Dependencies

This page is for extension developers building custom Siddhi extensions and wiring them into the Extension Installer panel. For instructions on installing and uninstalling existing Siddhi extensions, see Downloading and Installing Siddhi Extensions.

Configurations of Siddhi extensions are loaded from the <SI_HOME>/wso2/server/resources/extensionsInstaller/extensionDependencies.json configuration file.

When you are working with custom extensions, and if you want a custom extension to be installable from the Extension Installer panel, you need to add the configuration of the extension to this configuration file.

The configuration of an extension is a JSON object that looks as follows:

    "<extension_name>": {
      "extension": {...},
      "dependencies": [
        {...},
        {...}
      ]
    }

<extension_name> which is the key of this JSON object, is the uniquely identifiable name of the extension. The extension is described under extension.

extension

This object contains information about the extension, denoted by the following properties.

Property Description
name The uniquely identifiable name of the extension.
displayName The displayable name of the extension.
version The version of the extension.

The following is an example of the extension object, taken from the configuration of the jms extension.

  "jms": {

    "extension": {
      "name": "jms",
      "displayName": "JMS",
      "version": "2.0.2"
    },

    "dependencies": [...]
  }

dependencies

This is an array. Each member of this array is an object that denotes information of a dependency of the extension via the following properties.

Info

The jar of the Siddhi extension itself should be added as a dependency too. e.g., In the configuration of the jms extension, you can see that siddhi-io-jms has been listed as a dependency under dependencies.

Property Description
name The uniquely identifiable name of the dependency. If this dependency denotes the jar of the Siddhi extension itself, it starts with siddhi-.
version The version of the dependency.
download

This denotes download information of the dependency via the following properties.

  • autoDownloadable: This specifies whether the dependency is auto downloadable via the true and false values. If the value is false, the property is manually installable (see Manually installable dependencies).
  • url: If the dependency is auto downloadable, this specifies the URL via which the JAR of the dependency is downloaded.
  • instructions: If the dependency is only manually installable, this property provides instructions to download (and if applicable, convert) the JAR of the dependency.
usages

This is an array. Each member of this array is an object that denotes a directory where the jar of the dependency needs to be placed. Each such directory (location) is denoted by the following properties:

  • type: The type of the JAR. Possible values are as follows:
  • BUNDLE: This means that the dependency JAR is an OSGi bundle.
  • JAR: This means that the dependency JAR is not converted to an OSGi bundle.

  • usedBy: This indicates whether the JAR is used in runtime or in samples. For more information, see the explanation of installation locations under Manually installable dependencies
lookupRegex The regex pattern for the file name of the JAR. This is useful for to looking up and detecting whether the JAR is available in the locations mentioned under usages.

The following examples, taken from the configuration of the jms extension, show the members of the dependencies array.

Example 1: Auto downloadable dependency

This denotes the hawtbuf dependency of the jms extension, which is auto downloadable from the URL specified in download.url.

  "jms": {
    "extension": {...},

    "dependencies": [

      {
        "name": "hawtbuf",
        "version": "1.9",
        "download": {
          "autoDownloadable": true,
          "url": "https://repo1.maven.org/maven2/org/fusesource/hawtbuf/hawtbuf/1.9/hawtbuf-1.9.jar"
        },
        "usages": [
          {
            "type": "BUNDLE",
            "usedBy": "RUNTIME"
          },
          {
            "type": "JAR",
            "usedBy": "SAMPLES"
          }
        ],
        "lookupRegex": "hawtbuf([_-])1.9.jar"
      },

      ...
    ]
  }

Example 2: Manually installable dependency

This denotes the activemq-client dependency of the jms extension. This dependency needs to be manually downloaded, and the conversions should be done based on the given download.instructions.

  "jms": {
    "extension": {...},

    "dependencies": [
      ...,

      {
        "name": "activemq-client",
        "version": "5.9.0",
        "download": {
          "autoDownloadable": false,
          "instructions": "Download the jar from 'https://repo1.maven.org/maven2/org/apache/activemq/activemq-client/5.9.0/activemq-client-5.9.0.jar' and convert ..."
        },
        "usages": [
          {
            "type": "BUNDLE",
            "usedBy": "RUNTIME"
          }
        ],
        "lookupRegex": "activemq([_-])client([_-])5.9.0(.*).jar"
      }
    ]
  }