Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Installation
This chapter guides you through the steps to install AMQ JavaScript in your environment.
2.1. Prerequisites Copia collegamentoCollegamento copiato negli appunti!
To begin installation, use your subscription to access AMQ distribution files and repositories.
To use AMQ JavaScript, you must also install and configure Node.js for your environment. See the Node.js website for more information.
AMQ JavaScript depends on the Node.js debug module. See the npm page for installation instructions.
2.2. Installing on Red Hat Enterprise Linux Copia collegamentoCollegamento copiato negli appunti!
AMQ JavaScript is distributed as a zip archive. Follow these steps to install it in your environment.
- 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 JBOSS INTEGRATION AND AUTOMATION category.
- Click Red Hat AMQ Clients. The Software Downloads page opens.
- Download the AMQ JavaScript Client zip file.
Use the
unzipcommand to extract the file contents into a directory of your choosing. This creates a new subdirectory namednodejs-rhea-<version>.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure your environment to use the installed library. Add the
node_modulesdirectory to theNODE_PATHenvironment variable.cd nodejs-rhea-<version> export NODE_PATH=$PWD/node_modules:$NODE_PATH
$ cd nodejs-rhea-<version> $ export NODE_PATH=$PWD/node_modules:$NODE_PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow To make this configuration take effect for all new console sessions, set
NODE_PATHin your$HOME/.bashrcfile.Test your installation. The following command returns zero if it can successfully import the installed library.
node -e 'require("rhea")'; echo $?$ node -e 'require("rhea")'; echo $? 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Installing on Microsoft Windows Copia collegamentoCollegamento copiato negli appunti!
- 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 JBOSS INTEGRATION AND AUTOMATION category.
- Click Red Hat AMQ Clients. The Software Downloads page opens.
- Download the AMQ JavaScript Client zip file.
-
Extract the file contents into a directory of your choosing by right-clicking on the zip file and selecting Extract All. This creates a new subdirectory named
nodejs-rhea-<version>. Configure your environment to use the installed library. Add the
node_modulesdirectory to theNODE_PATHenvironment variable.cd nodejs-rhea-<version> set NODE_PATH=%cd%\node_modules;%NODE_PATH%
$ cd nodejs-rhea-<version> $ set NODE_PATH=%cd%\node_modules;%NODE_PATH%Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Preparing the library for use in browsers Copia collegamentoCollegamento copiato negli appunti!
AMQ JavaScript can run inside a web browser. To create a browser-compatible version of the library, use the npm run browserify command.
cd nodejs-rhea-<version>/node_modules/rhea npm install npm run browserify
$ cd nodejs-rhea-<version>/node_modules/rhea
$ npm install
$ npm run browserify
This produces a file named rhea.js that can be used in browser-based applications.