2. Deploy the sample application to Bluemix
- Download the code (mqlight-fishalive-node.zip) from the following GitHub project: https://github.com/ibmecod/mqlight-fishalive-node
Click Clone or download and select Download ZIP
- Extract the files from the zip file to an empty directory and navigate to this directory. Edit the manifest.yml file and update the
services: entry for both applications to match the application name that you set in Step 1.
Save the updated file.
- From the same directory, use the Cloud Foundry
cf logincommand to log into Bluemix and select the organization and space with your Message Hub service. Push the backend and front-end apps by running the
During this deployment, the backend application is pushed to Bluemix and started first.
Note the use of the
no-route: trueoption for this application in the manifest file. This prevents Bluemix from creating an external route for this worker application.
Also, notice that two instances of the worker will be started.
- When the deployment finishes, run the
cf appscommand or use the Bluemix dashboard to see that the applications are running.
- Use the
cf appsto see the status of applications.
- Use the
- Use the Bluemix Cloud Foundry Apps dashboard to check the status of the applications.
- Enter the URL shown in a browser or click the link from the dashboard to load the front-end application. Click Submit Work to send messages for processing by the back end.
The backend converts words to uppercase and they are retrieved for display in the browser in the order received. Note that words might appear out of order from the original submission because the workers are asyncronous.
- Run this command:
cf logs mql.fishalive.node.backend.Then, observe the output when you click Submit WorkObserve how the log shows both application instances for the worker receiving data from the front end.