IBM Bluemix

Starting with IBM Bluemix with Liberty for Java and Watson

IBM Bluemix, not only known for cloud computing but also for various services it provides. Watson is one of such services. This post gives info about how to start with IBM Bluemix and create a smart chat bot with Watson. Also in the later posts, I’ll provide tutorials for integrating Watson IOT and Facebook Messenger via a Java web service. So, first thing first, to start using bluemix click on this (IBM Bluemix ) URL and sign for trial. A trial version will be enough for developing and testing a chat bot, also it comes with support too. Complete the registration process by verifying the email address.

Success_bluemixOn the first time signing in a pop-up will ask you to create an organisation and select a geographical region.

Create_org

Then create a space for your development. Space is like creating an environment where resources and other configuration can be done.

Create_SpaceNow you are ready to develop an app on bluemix. Please note that the organisation and space created will be available in the same region in which they were created.

Developing Java application on Bluemix

To start with development we need to set up Java application on bluemix. For Java application IBM provides Liberty for Java app, select it from the app catalogue.

Bluemix_1

After selecting Liberty for Java, a page similar to below screenshot will open. Enter the app name and domain if you are going to opt for a personalised domain name. And then click on create button.

Bluemix_2

On successful create, app overview page will be displayed with status running. From this page, you can manage the installed Java application. Now we need to setup connection to other services, in this case, it will be to Watson Conversation. Click on connections tab to proceed.

Bluemix_3

 


Then connection tab will show all the connections of the Java app to other services. It can be a connection to the database, analytics, IoT or Watson services. From here you can add connections to existing services or create a new service to connect. For the first time since we don’t have any other service created, we will click on connect new to create a connection to new service.

Bluemix_4

 

On clicking to connect to new services catalogue page will open. For this post, I’ll select Watson conversation service to add to Java application.

Bluemix_5

 

Give a name to the service for better identification of an instance of that service. Once you’re done click on create to proceed with the creation of the service.

Bluemix_6

 

On successful create you’ll be redirected to manage  Conversation page from here you can manage connection for the Conversation service and also launch the tool to train the conversation. Now click on Connection tab to connect the Java app.

Bluemix_7

 

 

On connection tab of Conversation, you can see the installed Java application. Select the Java app and click on connect.

Bluemix_8

 

For connection, it needs to restage the app. So to proceed to click on the restage app button of the pop-up.

Bluemix_9

 

After the connection to the Conversation is done, we need to create a tool for the offline development and for build and deployment of the Java app. To create toolchain go to the Java app overview page and click on enable button inside the Continuous delivery tile.

Bluemix_10

 

Select Git repos and select repository type as a clone to clone the Java app to git. Give the repository a name and then click on Create button to configure the toolchain.

Bluemix_11

A page similar to below screenshot will load on successful creation of toolchain. Click on git tile to see the Java project cloned on the git repository.

Bluemix_11

 

On git repository link you’ll be able to see the folder structure. In the repo, you ‘ll see manifest.yml file. Make sure that manifest.yml contains the service name of the connected service (in this case Conversation service).

Bluemix_13

So now the Java app setup on bluemix is completed. And also Conversation is connected to java app. Now we are ready to program the Java application to use the Conversation service. In the next post, http://mytechthinking.in/2017/06/13/ibm-bluemix-cloning-source-code-from-git/ I’ll show how to clone the project from Git repository to local and how to troubleshoot common errors while cloning.

Leave a Reply

Your email address will not be published. Required fields are marked *