CommandBox is a tool that allows you to deploy your CFML applications through an easy-to-use command-line interface.
Instead of deploying a tomcat-based installer version of ColdFusion or Lucee, CommandBox utilizes an Undertow servlet and deploys a war file for the CFML server. This allows you to switch between a Lucee and ColdFusion server with the same application and configuration. In terms of configuration, rather than having a multitude of small files, you can control everything from a single JSON file containing all settings for the Undertow servlet, application server as well as any installed modules.
To install FusionReactor in CommandBox, we recommend that the commandbox-fusionreactor module is used. This is a module designed and maintained by Ortus (makers of CommandBox). The module, along with the FusionReactor module ensuring your FusionReactor instance is the latest version is stored in ForgeBox. This makes installation simple as you can run a single command to load the module.
With the commandbox-fusionreactor module installed, you have access to the fr command namespace. You can run commands such as ‘fr open’ to open FusionReactor in the browser. To make licensing FusionReactor simple, you can run ‘fr register “myLicenseKey”‘, this automatically applies your license key to each running instance.
Any modified settings in FusionReactor are stored in the reactor.conf file of each FusionReactor instance. With CommandBox you can set this reactor.conf file to be passed into each running instance by running: There are also several values you can set for FusionReactor directly through the server set command, see the full list here: https://commandbox.ortusbooks.com/embedded-server/fusionreactor#additional-jvm-args
The default behaviour of FusionReactor automatically detects the name of the running application and applies this to transactions. If you would like to disable this, you can do so by running:
The instance name of FusionReactor will either be set to the name of the directory you are running box from, or to the name of the CommandBox server. For example, if I have no server name set and run CommandBox from a folder called test, my instance is called test. You can override this value via the server name, which is a value defined in the server.json config file. You can set this value by running:
When removing the FusionReactor module, it is important to ensure that the –system flag is set on the uninstall command, i.e: If the system flag is not specified, CommandBox will try to uninstall from the current package, not from the CommandBox system packages. Running ‘box restart’ after performing the uninstallation ensures that the module is not stored in memory and reloaded when a CommandBox server is restarted.
When running in a Linux Desktop, we have seen that CommandBox can crash without warning. This is due to an issue with CommandBox interacting with the system tray. If you are running Ubuntu 18.04 or greater, you will be required to install the libappindicator-dev package to allow CommandBox to use the system tray. Alternatively, you can disable the CommandBox system tray element. To do this, run the following commands:
Commandbox-fusionreactor module
box install commandbox-fusionreactor
Licensing FusionReactor
Passing in configuration
server set fusionreactor.reactorconfFile=path/reactor.conf
Setting a fixed Application name
server set fusionreactor.autoApplicationNaming=false
server set fusionreactor.defaultApplicationName=myApp
Setting the Instance name
//Within CommandBox
server set name="myName"
//Outside CommandBox using environment variables
box server set name = "$var1+$var2+myName"
Removing FusionReactor
box uninstall commandbox-fusionreactor --system
Running in Linux
Local:
server set trayEnable=false
Global:
config set server.defaults.trayEnable=false
Configuring FusionReactor in CommandBox
Tags: comandbox