Posts

Using Maven Dependency Tree in troubleshooting

In this blog post, I'm going to explain how to check the  maven dependency tree and how it is useful in troubleshooting certain run time exception which we might encounter while running Spring applications. Maven Dependency  resolution: When you use maven, it uses its own dependency resolution mechanism to decide which jar to use when there is a conflict. Lets say you are using two dependencies, each of which have the same jar. Now, unless you pay attention, maven might end up using the incorrect jar version, and you will start getting exceptions like 'ClassNotFound' or 'NoSuchMethodError'. So, it helps to know which version of jar has maven resolved and is added to our application. This is where the Maven dependency tree helps us. Maven Dependency Tree: A simple command, "mvn dependency:tree -Dverbose " will print out the entire maven dependency tree. I will show with an example how to analyze this tree. Since is based on a issue I re...

Microservices using Pivotal Cloud Foundry

Have you ever faced the following issues in your projects: 1. Roll out features quickly to production: The customer needs very minor changes to functionality/UI and would like that to be rolled out at the earliest, because they have a higher business impact. However, we are not able to deliver it, because though it is a small change, we have to go through the whole nine yards of release processes involving full regression etc.  2. Move your application from one datacenter to another: You need to move your application to a different data center in a different geography due to various reasons (like legal, merger and acquisition etc). This might seem to be a herculean task to you. More often than not, you would get caught in a web of discovering (often surprising yourself!), a myriad of system configurations spread across file system, database, even worse within the code!!!. This is only going to make your task even more daunting. 3. Scale out your application based on modul...

Map Reduce Explained

Image
In this post, I'm going to write about Map Reduce Algorithm.  Map Reduce has taken the computing world by storm in recent years. It's massive scalability has given an edge to solving complicated problems. Map Reduce is often explained by the famous counting example (word count more often than not). I would also take the same route, albeit, a different example., let us count the number of books with the same name. Example: Suppose, there are 3 book shelves and each of them have different books. For brevity, let us say there are 4 different books in each of these shelves. First Shelf: "Harry Potter and the Half-Blood Prince" (count: 3) "The Da Vinci Code" (count: 1) "Think and Grow Rich" (count: 2) "The Bridges of Madison County" (count: 2) Second Shelf: "Harry Potter and the Half-Blood Prince" (count: 2) "The Da Vinci Code" (count: 2) "Think and Grow Rich" (count: 3) "The Bridges...

Spring Integration - Bulk processing Example

Image
In this post, I'm going to share my experience in using Spring Integration for a bulk processing task. This was the first time I was using Spring Integration and it did not disappoint me. It was pretty robust in terms of error handling and definitely scalable. Disclaimer: The actual task being performed has been modified into a fictitious e – commerce domain task, since I cannot reveal the original task which is customer specific and confidential. However, the nature of the task in terms of processing of clob and xml remain the same and the complexity of the original task has been retained. Also, the views posted on this post are strictly personal. Objective: The objective is to work upon customer information from an ecommerce application and process it and save it into database as clob data. The task is to perform data processing by reading xml from a file in the file system and then store it as clob into a table. Following is the high level of tasks required t...

Spring Integration - Introduction

Image
In this blog post and the subsequent post, I'm going to write about Spring Integration and also share my experience in using Spring Integration in a live project. To begin with, I will provide a brief introduction to Spring Integration framework and in the next post I will show how to apply it. Much of the content of this post is taken from the Spring Integration official website Spring Integration Reference What is Spring Integration? Spring  Integration   is a Spring driven framework which supports message driven architecture and provides routing, transformation of messages and implements the common Enterprise Integration patterns, more importantly the "Pipes and Filters" pattern. What is Pipes and Filter Pattern? This is an Enterprise Integration pattern, which is applied, if multiple processing units are required to process a message and we need to increase reuse and also achieve decoupling. The "filters" represent any component that is...

HTML5 Canvas - Basics

Image
In this post we will take a look at the HTML5 Canvas element and how to use it. What is canvas? HTML5 canvas element provides platform to draw stuff on it and also animate them. How to create a Canvas? Canvas is a html5 element, which is created as below: <canvas id="mycanvas" width="578" height="200"></canvas> How to get a handle to the canvas? In order to draw shapes or write text into the canvas, we need to get a handle to the canvas object. This could be done in javascript as below: <script>       var canvas = document.getElementById('myCanvas');       var context = canvas.getContext('2d');  //TODO </script> Entire html code: <!DOCTYPE HTML> <html>      <body>     <canvas id="myCanvas" width="578" height="250"></canvas>     <script>       var canvas = document.getElementById('my...

HTML5 Form Fields

Image
In this post I'm going to write about HTML5 form fields.  HTML5 has introduced a lot of input controls, which would otherwise been very tedious to code using javascript. Note that if the browser does not support any of these controls, it would just render a plain text field. 1. Color Picker: <input type="color"/> 2. Range slider This input type displays a slider within min and max range of values. <input type="range" min="10" max="80"/> 3. Date  <input type="date"/> 4. Email <input type="email"/> 5. URL  <input type="url"/> 6. Datalist  <input type="text" list="states"/>  <datalist id="states">          <option value="CA">          <option value="TX">          <option value="FL">  </datalist> The datalist input type provides a sugges...