Monday, October 19, 2015

HTTPS for route urls on Bluemix

The displayed url of the routes of the apps on Bluemix start with http and did you know that the https is supported (implicitly), well, this had been my recent finding. The next question would be how to enforce routing via https only and not through http. I prefer to do it programmatically, nevertheless, am exploring more on the options offered by Bluemix.  The idea is to get the scheme of the incoming request using request.getScheme(), check if it is equal to http then redirect to https url. For a traditional java web app this could be achieved by using a Servlet Filter and for spring based applications create a CustomHandler extending the HandlerInterceptorAdapter, override the preHandle() method. If you are using Spring Boot, the main class need to extend the WebMvcConfigurerAdapter and override the addInterceptor() method to add the CustomHandler to the registry.

Sunday, September 13, 2015

AWS in plain english


Came across this site via a friend, has info about various services and capabilities of Bluemix. Good One, nicely compiled and tabulated.

Monday, September 07, 2015

Stackifier


I came across the Stackifier today. You just need to paste the stack trace on the left side and it nicely categorizes [not sure if this is the right word here, ;) ] on the right side of your screen. Most of the libraries are already added and there is an option to add more. This tool comes handy if you are debugging a prod issue while listening to the proceedings of the SEV1 call. 

Tuesday, September 01, 2015

Calculating Cloud ROI


One of my colleagues pointed me to this very good article on calculating Cloud ROI from a customer perspective, interesting read.

Monday, August 31, 2015

NodeJS App running on IBM Container hosted on Bluemix

In this post, I'll develop a simple nodejs app, that does no more than saying 'Hello World' and run this app from a IBM container on Bluemix. The purpose of this blog entry is to use the IBM Container Extension (ice, for short) to build a docker image and run it on Bluemix. I have attempted to make it step by step, do-it-yourself kind of a post with screenshots as applicable. If you have any questions, drop a comment and I'll answer it. Let's get started.

Pre-req:
  1. Valid Bluemix account. In case you don't have it, sign up for a 30 day trial on http://bluemix.net. Create a namespace/private repo by clicking the containers icon on the dashboad, this is a one time activity and your images will be stored in registry.ng.bluemix.net/
  2. Cloud Foundry command line installed. You can download the installer for your OS from https://github.com/cloudfoundry/cli#downloads.
  3. Docker installed on your machine. I'd be using docker toolbox (Docker 1.8.1) but the commands would work fine with boot2docker (Docker 1.7) as well.
  4. IBM Container extension. You'd need to install python and use pip to get the ice CLI. If you are using a Mac OS (like me) install Homebrew that'd take care of installing setuptools and pip. If you are using Windows, follow the instructions on this URL - https://developer.ibm.com/answers/questions/201614/how-to-install-the-ice-cli-to-manage-containers-on.html. Note: I prefer to use ice for all the container extension commands, you can use cf ic as well.
After installing the pre-reqs, check the installations using the docker -v and ice version commands from the terminal or command prompt, you should see something similar to the image below

 Start the docker daemon using docker-machine start default, note that default is the name of my vm, it is the vm that is installed by docker toolbox. From the terminal set the required environment variables for the docker client on the terminal, using docker-machine env default command, alternately you can wrap it inside an eval on terminal if you are using Mac.

After starting the docker daemon and having the docker client ready, issue the ice login command. This will prompt for the username and password, key in your Bluemix credentials and you should see that Login succeeded.

 Now, get the list of images available by issuing ice images command, this will bring up all the available images from the repository.
Spend a moment going over the available list of images.
Pull the ibmnode image, I'll be using this as the based image to create an image with my nodejs app.
Type ice --local pull registry.ng.bluemix.net/ibmnode:latest. Note that --local flag will execute the commands using the docker client targeting the docker daemon. This might take sometime based on your network connection speed, wait till you see the message "status: Downloaded newer image for registry.ng.bluemix.net/ibmnode:latest".

Run the image using either docker run or ice --local run, I'll use docker run and enter the root of the image to check the nodejs version. This image of IBM Container comes pre-installed with nodejs, otherwise, we need to install it using the apt-get commands on the base image. Type docker run -i -t registry.ng.bluemix.net/ibmnode:latest /bin/bash, this will take you the bash shell of the image and type node -v for the version of nodejs, you should see like the one below:

You can exit the bash shell using exit command and for the house keeping, use docker rm to remove any unused containers, get a list of containers using docker ps -a to display all stopped containers.

Lets build our nodejs app, for brevity, I have excluded the package.json file as this is a simple app, copy the following in to a file called hello.js, this is a simple script that starts the http server on port 9080 and print Hello World when invoked.


Create the Dockerfile with the following content, will use the ibmnode as the base image and copy the hello.js file to it, the last line starts the node with hello.js.



Now, lets build an image, open the terminal from the directory where the hello.js and Dockerfile are located and issue the command ice --local build -t {image name} . , the trailing '.' denotes the current directory. This will build a local image and watch for the message 'Successfully built '. Run the image locally with ice --local run -p 9080:9080 -d {image name}. The -p flag binds the port of the host with that of the container and -d runs the container in daemon mode. Get the ip of the docker machine and use the curl command to check the node app, all three are shown in the below image:

After confirming that the image is ready, it can be pushed to the registry on Bluemix. Before pushing the image needs to be tagged, type the command ice --local tag -f registry.ng.bluemix.net/{your namespace}/{image name}. Now push the image using ice --local push registry.ng.bluemix.net/{your name space}/{image name} and wait for the success message. Check that your image is pushed using the ice images command.
Run your image on Bluemix using the run command (no local flag):
ice run -name -p 9080 registry.ng.bluemix.net/{name space}/{image name}. This will print a container id, save it for further use. Optional: check your container running
using the ice ps command.

For any diagnostic purposes, you can use ice inspect that will print a JSON string with all the properties of the container. Support team usually asks for this log stack to troubleshoot.

Now, lets bind our container to a public ip.
Request a public ip using ice ip request, this will print an available floating ip. Bind the ip to the container using ice bind {ip} {container id} . Now, you access your nodejs page using the ip:9080 from the browser. That's it, you just deployed your nodejs app running from a container on Bluemix.

Note: If you plan to release the floating ip, use ice unbind {ip} and ice release {ip} commands.

Thursday, January 22, 2015

New Cool features of Mule ESB 3.6

The recently released Mule ESB 3.6 has some really cool features, though I chanced to try out features like Agents, REST consumer (similar to WSDL consumer) while it was in beta state, they had issues and I had to wait till the version is formally released. It is time to give these a spin again.
The list of the features in 3.6 are mentioned pretty nicely in this link. Enjoy!

Monday, January 05, 2015

2014 Java Library and Tools

Happy new year to you and your family!!
I came across this link today that has good details and description of the various & popular, of course, java libraries and tools. Worth the read.

Friday, December 19, 2014

An year with Mule ESB

Hola! It had been a little while since I blogged an entry. Had been bit held up due to the change in job, and little did I realize that it had already been an year after accepting this senior role with a company that is a premium partner of MuleSoft. Yep, my day to day job involves working with Mule (Anypoint Platform) heavily, providing integration solutions to our customers and helping customers realize the benefits of using Mule ESB, both on premise and Cloud Hub. After working with Mule for more than an year now, I can comfortably say that Mule ESB lives up to its claims. It is pretty light weight and does not force you to bring an elephant in to the room. I am happy that I could roll out multiple projects successfully and integration using Anypoint platform is a breeze. Am just loving the RAML and whipping up services using the APIKit. Looking forward to an more exciting new year. Happy holidays!

Sunday, September 07, 2014

Git Flow Cheat Sheet

A good link on the Git flows, must read for all those using Git.

Sunday, February 23, 2014

Guide for users to switch over to Intellij from Eclipse

I wanted to switch over to Mac and had been waiting for sometime and that was accomplished in Dec, 2013 and the next thing was to make IntelliJ as my primary IDE for Java development, that didn't happen and had some road blocks as I had to stick to Mule Studio that is Eclipse based. After reading some helpful tips from this link, I found using IntelliJ pretty productive for Java Development.

Saturday, September 14, 2013

REST Vs SOAP


Here is a good link that I came across today while browsing. Has some very good perspectives.

After a looong pause ...


Well, it had been a while since I posted on my blog, this is partially due to ever increasing professional work and I had been posting on company's internal blog, we call it Architect's blog ;). Of late, I developed interest in the NoSQL Databases and am currently undergoing the MongoDB for Java Developer's course. Pretty good course, I must say, more on this in a later post as I have almost completed the 7 week course and doing the final exam. REST webservices is another area of my interest right now.

Saturday, December 11, 2010

Year.introspect(2010)

Time has come again to look back and introspect on happenings of this year to learn and equip myself better for the next year. This year had been very interesting both on the personal and work fronts. On the personal side, we had a baby boy on Oct 11 and am starting to get used to the nappy changing duty ;). It is so much fun playing with my son and watching him grow. Babies are the cutest things in this world.

On the work side, we did a successful BPEL deployment. It was indeed a good learning experience, especially, with 3DNS/Big IP acting up in production preventing the partner links from being invoked (more on this topic later). Enabling service Orientedness for the application was another fun filled exercise - coaching the team on BPMN, service identification, training the team on BPEL, whipping up schemas and more importantly getting the buy in from stakeholders and peers. Did a bit of hacking to remote deploy all the bpel suitcases to the BPEL console using commons-http-connection. We are still on BPEL PM 10.1.3.4 and have a plan to migrate to SOA Suite 11g sometime mid next year. I have also created an installer for my application based on ant installer, this is a cool stuff that helps in deploying the applications (silently) to the target envs and the dev team can stay away while the ops team does the installation :).

I read Robin Sharma's two very good books - Leader who had no title and the monk who sold his Ferrari, both are very good books and I highly recommend reading them. I have also read few technical books - BPMN method and style by Bruce Silver, Oracle SOA Suite Developer's Guide, Getting Started with SOA Suite 11g, Enterprise Architecture A - Z.

Tuesday, October 26, 2010

Instance created!!!

At 2010-10-11T17:26:00+05:30Z, an instance of an anonymous inner class has been created. The toXML() of the instance is below:

<Event name="child birth">
<Name> TBD </Name>
<DateofBirth>Oct 11, 2010</DateofBirth>
<TimeofBirth>17:26</TimeofBirth>
<PlaceofBirth>Basant Sahney Hospital, W Marredpally, Hyderabad</PlaceofBirth>
<Gender>Male</Gender>
<Weight>2.72 KG</Weight>
</Event>

The instance is yet to be named per com.astrology.zodiac.* standards and bind to the Srirangam namespace.

And thats the reason I'm not active on the blog ;) and another reason is we have an internal blog in our company that runs on moss and most of my blogging activity is happening on the internal blog.

****** UPDATE ******
The instance is named Nischay!

Tuesday, August 03, 2010

Thursday, June 03, 2010

BPEL Deployment plan to replace queue names

We are using Oracle BPEL PM 10.1.3.4 and we are using the deployment plan feature to take care of the replacement of the wsdl end points and schema content. We realized that the queue names were not being replaced with simple search and replace. As guessed, the search replace functionality worked only for the wsdls where the host and port names were getting replaced correctly. Following needs to be done to have it working for the queue names:
1. Include the jca namespace in the deployment plan file [xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"]
2. Use the following to replace the queue name
<jca:property name="QueueName">
<searchReplace>
<search>oldqueuename</search>
<replace>newqueuename</replace>
</jca:property>

3. Most important of all, ensure that the above entry is the first inside the <wsdlAndSchema> element, otherwise, there'd be errors during deployment and the queue names shall not be replaced.

Monday, May 24, 2010

Long Pause

I had been silent on the blog for quite a while, the reason being, apparently, too much of activity at work and domestic fronts. Life is back to normal and things are under control now. I'd be writing few entries on the BPEL this time, so watch the space ;)

Saturday, February 06, 2010

Programmer Types

We have heard of types of architects, this blog entry talks about types of programmers based on two attributes - planning and sophistication. Another dimension of looking at things!

Apache Thrift

Apache Thrift - "Thrift is a software framework for scalable cross-language services development. It combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and OCaml.". Sounds pretty interesting.

Wednesday, November 25, 2009

Year.introspect(2009)

Yet another year!
This year I made no more than 7 blog entries, the reason for being quite on the blogging front is that significant time was required to be spent on the work and personal fronts and seldom had a chance to blog.

On the work front, had a absoutely eventful year. Moved to a different domain within in the same company and it is very interesting to roll out the projects in a relatively shorter time frames whose business impact is very conspicuous. Had a very delightful time designing the stuff and educating the team. Btw, I got promoted as well :)

On the personal front, nothing great but got used to family life and the daily chores :). Early september, we managed to get a week off and went to Kerala. The vacation was much needed and was very refreshing.