Skip to content

Installation guide

Jan Martiska edited this page Mar 15, 2021 · 4 revisions

To provision a WildFly instance with the GraphQL feature pack, you need Galleon. Download a distribution from https://github.com/wildfly/galleon/releases and add its bin directory to your path. It contains the galleon.sh (and galleon.bat) script, which is what you need to run Galleon.

One-step installation using a provision.xml file

You can feed Galleon with a descriptor, provision.xml, which includes all the necessary information to provision a WildFly instance with the GraphQL layer installed. It can look like this:

<installation xmlns="urn:jboss:galleon:provisioning:3.0">
    <feature-pack location="wildfly@maven(org.jboss.universe:community-universe):current#21.0.0.Final">  <!-- WildFly version -->
        <default-configs inherit="false"/>
    </feature-pack>
    <feature-pack location="org.wildfly.extras.graphql:wildfly-microprofile-graphql-feature-pack:1.1.0.Final"> <!-- Feature pack version -->
        <default-configs inherit="false"/>
    </feature-pack>
    <config model="standalone" name="standalone.xml">
        <layers>
            <!-- The base server -->
            <include name="cloud-server"/>
            <include name="jmx-remoting"/>
            <include name="management"/>
            <!-- Layers from this FP -->
            <include name="microprofile-graphql"/>
        </layers>
    </config>
    <options>
        <option name="optional-packages" value="passive+"/>
    </options>
</installation>

The requested versions of WildFly and GraphQL feature pack are contained in the file, see the comments inline. Make sure you use a valid combination of WildFly and feature pack versions - see this document. To run the provisioning, execute

galleon.sh provision provision.xml --dir=wildfly

where --dir denotes the directory where you want to install the distribution

Provisioning using Galleon commands

You can also provision a base WildFly instance first, and then install the GraphQL layer on top. Provision WildFly:

galleon.sh install wildfly:current --dir=wildfly              # install the latest version
galleon.sh install wildfly:current#21.0.0.Final --dir=wildfly # install a specific version

Optionally you can add --layers argument specifying which layers to install if you don't want the full installation. For example: --layers=jaxrs-server

Then, to install the GraphQL layer:

galleon.sh install org.wildfly.extras.graphql:wildfly-microprofile-graphql-feature-pack:1.1.0.Final --layers=microprofile-graphql --dir=wildfly

Installing without Galleon

If you for some reason really can't use Galleon for provisioning your WildFly instance, we provide an overlay zip that you can unzip into your WildFly instance. You can download it from the GitHub releases page (should I forget to attach it to a release, let me know!). You can also build it yourself - after building the repo with Maven, it will be at build/target/wildfly-${WILDFLY_VERSION}-mp-graphql-${FEATURE_PACK_VERSION}-overlay.zip

The overlay zip contains the necessary dependencies from the Reactive feature pack as well, so this guide assumes that you didn't install the Reactive feature pack. It also assumes you're using a 'full' WildFly, that is including the default MicroProfile APIs. And that you're using a profile with MicroProfile APIs included (standalone-microprofile.xml, for example)

After unzipping the overlay zip, you will also need to patch your configuration file.

In the <extensions> section, add the MicroProfile GraphQL and Context Propagation extensions:

        <extension module="org.wildfly.extension.microprofile.graphql-smallrye"/>
        <extension module="org.wildfly.extension.microprofile.context-propagation-smallrye"/>

Add the microprofile-graphql-smallrye and microprofile-context-propagation-smallrye subsystems:

        <subsystem xmlns="urn:wildfly:microprofile-graphql-smallrye:1.0"/>
	<subsystem xmlns="urn:wildfly:microprofile-context-propagation-smallrye:1.0"/>