Chapter 2. Installation
This chapter guides you through the steps to install AMQ JavaScript in your environment.
2.1. Prerequisites Copy linkLink copied to clipboard!
- You must have a subscription to access AMQ release files and repositories.
2.2. Installing on Red Hat Enterprise Linux Copy linkLink copied to clipboard!
Procedure
- Open a browser and log in to the Red Hat Customer Portal Product Downloads page at access.redhat.com/downloads.
- Locate the Red Hat AMQ Clients entry in the INTEGRATION AND AUTOMATION category.
- Click Red Hat AMQ Clients. The Software Downloads page opens.
- Download the AMQ Clients 2.8.0 JavaScript .zip file.
Use the
unzipcommand to extract the file contents into a directory of your choosing.unzip amq-clients-2.8.0-javascript.zip
$ unzip amq-clients-2.8.0-javascript.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow
When you extract the contents of the .zip file, a directory named amq-clients-2.8.0-javascript is created. This is the top-level directory of the installation and is referred to as <install-dir> throughout this document.
To configure your environment to use the installed library, add the node_modules directory to the NODE_PATH environment variable.
cd amq-clients-2.8.0-javascript export NODE_PATH=$PWD/node_modules:$NODE_PATH
$ cd amq-clients-2.8.0-javascript
$ export NODE_PATH=$PWD/node_modules:$NODE_PATH
To make this configuration take effect for all new console sessions, set NODE_PATH in your $HOME/.bashrc file.
To test your installation, use the following command. It prints OK to the console if it successfully imports the installed library.
node -e 'require("rhea")' && echo OK
$ node -e 'require("rhea")' && echo OK
OK
2.3. Installing on Microsoft Windows Copy linkLink copied to clipboard!
Procedure
- Open a browser and log in to the Red Hat Customer Portal Product Downloads page at access.redhat.com/downloads.
- Locate the Red Hat AMQ Clients entry in the INTEGRATION AND AUTOMATION category.
- Click Red Hat AMQ Clients. The Software Downloads page opens.
- Download the AMQ Clients 2.8.0 JavaScript .zip file.
- Extract the file contents into a directory of your choosing by right-clicking on the zip file and selecting Extract All.
When you extract the contents of the .zip file, a directory named amq-clients-2.8.0-javascript is created. This is the top-level directory of the installation and is referred to as <install-dir> throughout this document.
To configure your environment to use the installed library, add the node_modules directory to the NODE_PATH environment variable.
cd amq-clients-2.8.0-javascript set NODE_PATH=%cd%\node_modules;%NODE_PATH%
$ cd amq-clients-2.8.0-javascript
$ set NODE_PATH=%cd%\node_modules;%NODE_PATH%
2.4. Preparing the library for use in browsers Copy linkLink copied to clipboard!
AMQ JavaScript can run inside a web browser. To create a browser-compatible version of the library, use the npm run browserify command.
cd amq-clients-2.8.0-javascript/node_modules/rhea npm install npm run browserify
$ cd amq-clients-2.8.0-javascript/node_modules/rhea
$ npm install
$ npm run browserify
This produces a file named rhea.js that can be used in browser-based applications.