White Papers
Abstract
Sasipriya B
Senior Software Engineer
This whitepaper describes the deployment of Microservice applications in a Cloud Environment as containers using Kubernetes where they can communicate with one another.
A basic client application developed in RBD using EGL publishes/subscribes a message to IBM MQ queue using topic string and prints the status of the message in the console (in the client browser page and the service logs) through REST service.
Content
Introduction
In today's fast-moving world, Customers and Companies demand to deliver a wide range of services through the internet. Cloud computing plays a vital role in our day-to-day life as it can store and access data and programs over the internet instead of on a hard drive. Therefore, businesses of any size can harness powerful software and IT infrastructure to become expandable, leaner, and compete with many larger companies. Unlike traditional hardware and software, cloud computing helps businesses stay at the forefront of technology without significant investments in purchasing, maintaining, and servicing equipment.
Benefits:
- Lower Costs and More Efficient
- Improved Security
- Maintaining Business Continuity
- Agility & Adaptability
- Automatic Updates
So far, Rational Business Developer works on a multi-platform and now moving beyond by building applications on the cloud network.
Prerequisites
- Activated Azure subscription with Kubernetes Cluster - https://portal.azure.com/#home
- Ubuntu terminal (Windows using WSL/Linux) with docker installed - How To Install and Use Docker on Ubuntu 20.04 | DigitalOcean
- Or can use Docker desktop - https://docs.docker.com/desktop/install/windows-install/
- IBM Rational Business Developer (9.6 and above)
- Apache Tomcat server (9 and above) - https://tomcat.apache.org/download-90.cgi
- Jar files
- javax.jms-api.jar - https://mvnrepository.com/artifact/javax.jms/javax.jms-api/2.0.1
- com.ibm.mq.allclient.jar - IBM MQ Downloads for developers - IBM Developer



- Two web projects where Client and Service programs were developed in Rational Business Developer (RBD) using EGL.
- Web projects get converted to war files.
- War files are converted to a client docker image and a service docker image.
- Both the images get pushed to the Azure Kubernetes registry via the docker command.
- Deployment files of each application pull the docker images from the Azure registry using the cloud power shell.
- Containers get created with the respective deployment and service files. Once these containers start running, they will communicate with each other.
- Go to Window (in the workspace) → Show view → Servers → Right-click → New → Server.
- Select the Tomcat server and define the hostname. Click Next.

- Browse for the Apache installation directory, Click OK and Click Finish.

- After completing the Tomcat server setup, the user should double-click the server → Open Launch Configuration

Note:
- If the server is running, stop the server and go to the open launch configuration tab.
- If the 8080 port is running by some other apps, then modify the port number for both admin and HTTP ports.
Now, the window will prompt to edit the configuration properties.
- Navigate to the Classpath → User Entries → Add External Jars → select the two jars from the local directory → Apply → Ok.

- In the RBD Workspace → Right-click → New Project → EGL Project → Web Project → Project name (give project name) → Next.

-
In the target runtime, select Apache Tomcat 9 server as shown below,

-
Expand the project → EGL Source → Right-click → New → Service.

-
Enter the Package and EGL source file name as below. Select Create as web (REST) service and click Finish.


- Go to Serv. eglbld → right-click → Add part

-
Choose the Resource Associations part and click Next.

-
Give a name and click Finish.

-
The below tab displays the parameters specific to the MQ service. Click Add Association, give the file name, and select the File Type as mq.

-
Enter the parameter's value as shown below (password = passw0rd). Click save.

-
In the service web build options, clear the checkbox to list all the parameters. Select resourceAssociations, double click the corresponding value field, and click on the dropdown to add the created MQLink part.

-
Select the checkbox to get the Final web build options as below,

-
Click on the service deployment descriptor as below,

-
The service project needs to be deployed to a web project, So click on New.

-
Provide the project name and click Finish. The target project name will be displayed below.


-
Now, Add the two jar files in the deployed web projects of both client and service, as shown below.


- New → EGL Project → Rich UI Project → give project name → Next.
-
Select the necessary widget libraries and click Next.

-
Select the service project to link client and service. Click Finish.

-
Expand the RUI project → EGLSource → Right-click → New → Rich UI Handler.

-
A pop-up will be displayed where the package and the source names are defined. Click Finish.

-
To create the interface for the REST service, navigate to the service project and right-click the service EGL program → EGL Services → Extract EGL Interface…

-
The source folder picks the default one. But the interface must be in the client project, so change the source folder to the client EGL Gen Source folder. Click Finish.
The interface will be created in the client project as below,
Navigate to the deployment descriptor of Client RUI
ClientUI.egldd → Service Bindings → Add → REST service binding → Next








- After creating the sample, the user must generate and deploy the projects. For a service project, right-click on the service program (Serv1.egl) → Generate with Wizard → Finish.

-
A successful generation will be displayed as below,

-
Once Generation is successful, right-click service project (Serv) → Deploy the EGL project. The Service will get deployed to its target web project (MQService). The successful deployment will be displayed as below,

-
Likewise, the Client is generated and deployed. Right-click client project (Client UI) → Generate. If the generation is successful, then the below console is displayed.

-
For Deployment, Right-click client project (Client UI) → Deploy EGL project. A successful deployment will be displayed as below,







scp < zip folder name > < username@ip address:directory/>
Example: scp client.zip azure@10.56.87.34:home/
unzip the folder and navigate to the client folder as shown below.






- IBM MQ
- Service
- Client
Note: YAML files contain the configuration details about running a container which then converts that information to JSON when making the API request. For more details about the YAML file, refer 3rd link in the reference section.





Example: https://52.149.195.104:9443/ibmmq/console/login.html
Enter the credentials to create Queue and the user (By default username=admin and password=passw0rd)
The IBM MQ web console page looks as below,

- A Queue - a named destination to which messages can be sent
- A Topic name and a Topic string - subject of the information that is published in a publish/subscribe message.
- A subscription - can receive messages, about the same or different topics, from more than one publisher












In IBM MQ publish/subscribe, a publisher is an application that makes information about a specified topic available to a queue manager in the form of a standard IBM MQ message called a publication. A publisher can publish information of more than one topic.

Note: Before publishing the message, click on the “subscribe” button so that a subscription gets created on the MQ web console.
Once the message gets published, the status will appear as shown below.

To see the updates in the service console, open the Azure cloud shell and Enter the below commands.
- kubectl get pods
- kubectl logs <service pod name>

The message will be published to the Queue as well as to the subscription



- kubectl get pods
- kubectl logs <service pod name>

The message will remain in the queue but disappears from the subscription.

- Flow chart of working model
- Steps to create a sample application
- Creating docker images on the Ubuntu terminal
- Deploying the application on the Azure cloud
- Running the containers
- MQ Publish and subscribe
- IBM MQ web console - Quick tour of the New Web Console
- MQ(pub/sub) - IBM MQ Technical overview
- YAML file - Introduction to YAML: Creating a Kubernetes deployment
- JMS subscription - Using provided subscriptions with WebSphere MQ classes for JMS (ibm.com)
Was this topic helpful?
Document Information
Modified date:
13 October 2022
UID
ibm16612681