List of Tibco RV, EMS Tutorials , Tips from Javarevisited

Hi guys , just thought about some more topics to explain on this tibco tutorial series , let me know out of below which Tibco topics you would like to me cover first , please suggest if you have other topics in mind. I am now updating this post as most of the topics are already covered but I forgot to update this post.

I have covered difference between routing daemon and Tibco daemon in this part. basically main difference between both of them is the purpose. RVD is mainly for sending and receiving message in same network between two Tibco RV publisher and subscriber while RVRD is used to bridge two different network from two different countries, cities or even continent. Most of the investment banks has RVRD bridging there London to New-york traffic or London to Tokyo traffic. Bandwidth of these WAN networks are very important because if  you have just one slow Tibco subscriber that can bring down whole network link between two regions. We had an incident when one of out application is publishing huge amount of updates in MB and on other side we had a GUI on a slow desktop which is keep asking for resend, this problem is often referred as Tibco RV storm and its very serious issue while working with Tibco messaging. One important thing to note here is reliability parameter of tibco rv which actually defines how long publisher should hold the message if set very low can cause frequent retransmission request.

Tibco tutorial : Certified Messagging

This is in continuation of my previous tibco tutorial. tibco rv is most widely used middleware in enterprise world heavily used in banking and many global investment bank rely on tibco rv for there high speed messaging requirement. its used by many trading application to receive high speed data e.g. Market data. in reliable mode tibco provide reliable delivery of data but not guaranteed means if sender sends data to receiver via tibco multicast network , tibco tries best to deliver that data to receiver but there is no guarantee, data could be lost if receiver is too busy to receive it , if receiver is not running or receiver is hang. In some cases its possible to recover lost data by sending "Resend Request".

What are builtin Properties in ANT >> Tutorial Example

This is the fourth article of series "ant tutorial for beginners" here I have included some more fundamental concept in form of Q/A to provide you clear and concise description and situation where you apply these concept. Please let me know if you have any questions , comments I will be happy to reply those .

What are built in properties available in ant ?
Built in properties are those which ant provides by default , you need not have to declare these property you can just use it. You can divide them in two parts

Top 30 Eclipse Keyboard Shortcuts for Java Programmer

This tutorial is about 30 Eclipse keyboard shortcuts, this list is by no means complete and I will suggest you guys to share eclipse shortcuts listed other than here to make this more useful. Eclipse is the most used Java development IDE and knowing Eclipse shortcuts not only improve your productivity but also makes you more efficient. You will have more time for things you like to do. Using keyboard shortcuts also helps to impress colleagues and shows that you have a good hold on tools you used for Java Development. If you are a Java developer, who use Eclipse as its main IDE for all coding, development, and debugging purpose, then I also suggest you to take a look at The Java Developer's Guide to Eclipse, 2nd Edition, one of the best book to learn how to use Eclipse from Java programmer's perspective.

How to write build.xml and run build in Apache ANT

This is the second article on Apache ANT tutorials for beginners series As I have always said that I like short , clear and concise tutorial which tells about few concept but in a clear and concise manner and put weight on fundamentals . I try to adopt same theory while writing my blog post while writing my experience coupled with concept which is important for a software developer point of view.

Hot to build project using Apache ANT ? ANT Build Tutorials for Beginners

Apache Ant tutorials for beginners

Hi Guys, today I would like to share some of my experience while working with ant build tool in form of short ant tutorials, ant is one tool which has gained its place in almost everywhere, it’s integral part of any project’s build system and provide foundation for complex, extensible build environment. I have been using ANT from my early programming days and I have seen some of the best designed build environments around ANT. In these ant tutorials for beginners we will see what is ant build tool? How to use ANT for building project? Fundamentals of ANT build tool, setting up ant build environment etc. I have created a series of ant tutorials and you can check next part of ant tutorials by following links ant tutorial part 2 and ant tutorial part 3

MySql Tutorial : mysqldump utility in mysql

The mysqldump client is a backup program o It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

MySQL tutorial and commands part 3

Hi Guys , here are some more mysql commands which is useful in day 2 day work.

Method for converting current time stamp to date:
select from_unixtime(left(1201159475416, 10));
this  method is used to convert the timestamp to the date time format in mysql ,left() method will return 10 char from the specified string  if we store time stamp value in millisecond.

MySQL tutorial and commands part 2

Here are some more mysql commands from which is very useful for anyone working with mysql database.
this are very useful for application developer which is going to use mysql database for there applications.

Increasing no of connections for mysql
You can increase this value in main config file (e.g., /etc/my.cnf) using this syntax:


MySQL tutorial and commands Part 1

Here is first set of my basic mysql commands which I have used in my day to day life while working with mysql database.

For Checking Wheather MySQL Server is running or not
ps -auxwww | grep mysql

Starting mysql
go to mysql installation directory and execute below command

How to use Regular Expression in Unix Linux

-->One of the most powerful tools available to programmers are Regular Expressions, if you are good with regular expressions you can solve many day to day problem extremely quickly e.g. find all the lines with ERROR in log file , find count of any particular ID in log file , find exceptions etc.

Improving Performance of java application

This is a big topic to discuss as there are many approaches which involves to analyze performance of an application starting from profiling application to finding bottleneck.

here I am putting some of the basic tricks for improving performance which I learnt in my early days in java , I will keep posted some approach , experience on performance improvement as and when time allows.

for now here are naive's tips for making your program run faster.

1. Use bit shift operator for multiplying and divide by 2 , computers are very fast with bitwise operation.

2. Use stringbuffer in place of string if you are doing lots of string manipulation it will reduce memory by avoiding creating lots of string garbage. If you are using java5 then consider stringbuilder but that is not synchronized so beware.

3. try to make variable , class , method final whenever possible that’s allow compiler to do lots of optimization e.g. compile time binding so you will get faster output.

4. static methods are bonded compile time while non static methods are resolved at runtime based on object type so static method will be faster than non static.

5. don't call methods in for loop for checking condition e.g. length() size() etc.
instead of doing this , use modified version

for(int i=0; i<vector.size();i++)

int size = vector.size();
for(int i=0; i<size;i++) 

if you like to know about FIX protocol and its usage in Electronic trading or Derivatives trading e.g. Futures and options , foreign exchange and other asset class , Please see my FIX Protocol Tutorials series. I have shared my experience in investment banking and finance domain as form of short tutorial and could be used as start guide for any one new in FIX protocol and can compliment official FIX Protocol Technical specification in simple words.

If you are going for any FIX Protocol Job Interview you can quickly benefit from my FIX Protocol Interview Questions, those are questions mostly asked in Interview for a FIX developer position. It not just help in as quick reference for Interview but also opens new area of learning for new comers.

hope this would be useful.

Networking Basics for FIX Connection in Unix Linux

Knowledge of networking basics are extremely important if you are dealing with FIX connection , FIX stands for Financial Information Exchange protocol and its the most popular protocol for electronic trading and supported by many brokers , exchanges etc.

here I am discussing few important network related information which is quite useful for FIX connection establishment.

How to avoid deadlock in Java Threads

How to avoid deadlock in Java? is one of the question which is flavor of the season for multi-threading, asked more at a senior level and with lots of follow up questions. Even though question looks very basic but most of developer get stuck once you start going deep.

Interview questions starts with "What is deadlock?"
Answer is simple, when two or more threads are waiting for each other to release lock and get stuck for infinite time, situation is called deadlock . It will only happen in case of multitasking.

Top 10 Most useful cvs commands in linux/unix

This article is in continuation of my earlier article Top 10 basic networking Commands in Unix  and 10 tips of working fast in unix  to read more see here 10 tips of using find command in linux.

Here is my list of most useful commands in Linux , its important that we know this and use it regularly while working with files folders which is in CVS.

Top 10 basic networking commands in linux/unix

Networking is an essential part Unix and it offer lots of tools and command to diagnose any networking problem. When I was working on FIX Protocol we get lot of support queries to see whether FIX Sessions are connected or not. Since FIX Protocol uses sockets you can use net stat , telnet and other networking command available in Linux for finding problem and solve that.In this article I will show you basic networking commands in Unix and for what purpose they are used. with the combination of grep and find command on them you can troubleshoot most of networking problem.

Tibco tutorial : Tibco RV tips and commands

This is third post on series of "tibco tutorial" , In this article I am posting some of the most useful command which I used while working in tibco rv in many application , they are extremely useful and must be in developers top of head who is working in tibco rv.

Before writing these "tibco tutorial" series I looked for some introductory simple tibco tutorial which explains concept of tibco rv in simple word and give us working knowledge of tibco but I did not found any. tibco is most heavily used middleware solution on enterprise world and form backbone of many large enterprise including global banks.

Tibco Tutorial: Fundamentals of Tibco RV messagging.

This is in continuation of my  tibco tutorial series where I will discuss tibco rv on application developer point of view as middle ware or messaging solution.As discussed in earlier tibco tutorials, tibco is used for communicating between two systems e.g. client and server or server to server , here we will see some of the basic terms used in tibco rv  world.

TIBCO Tutorial : TIBCO Rendezvous or TIBCO RV messaging

TIBCO Tutorial:  TIBCO RV messaging
When I started working with a big investment bank I come across a new messaging technology called TIBCO Rendezvous or commonly called as TIBCO RV, I have heard Java Messaging Service (JMS) before but never heard about this TIBCO Rendezvous and it was so extensively used in my application that most of support issue was caused by this mysterious TIBCO RV. We had several TIBCO Topics also called TIBCO Subject separate for both Production and Non PRODUCTION environment but still since I don’t had basic knowledge of this technology I was afraid to do some experiment because there was always a risk to affect production environment.
At that time I have searched for TIBCO tutorial and I didn't find anything which can help an application developer who wants to use TIBCO as middleware solution, so I decided to write my own experience in a form of short , concise and clear  TIBCO tutorial  Every post of this series will have something to offer in a short and clear format which I like and I hope you too for details you can always refer to TIBCO Rendezvous or TIBCO EMS specification or documentation .

What is Abstraction in Java? Abstract Class or Interface

What is abstraction?
Abstraction in Java or Object oriented programming is a way to segregate implementation from interface and one of the five fundamentals along with Encapsulation, Inheritance, Polymorphism, Class and Object.  Abstraction in Java is achieved by  using interface and abstract class in Java. An interface or abstract class is something which is not concrete , something which is incomplete. In order to use interface or abstract class we need to extend and implement abstract method with concrete behavior. One example of Abstraction is creating interface to denote common behavior without specifying any details about how that behavior works e.g. You create an interface called Server which has start() and stop() method. This is called abstraction of Server because every server should have way to start and stop and details may differ. As I said earlier Abstraction in Java is implemented using abstract class and interface as discussed in next section. In fact what is abstraction in Java, difference between Abstraction and Encapsulation  is also a very popular core Java interview because strong OOPS skill is one of the primary requirement for Java developers.

Fundamentals of Object Oriented Programming in Java

I remember when I was doing my engineering , OOPS concept was in first semester. Back then it looks like some alien things to me, because I have never done programming and even the smallest program we get to write e.g. checking whether number is palindrome or not , or printing Fibonacci series , we never really needed to use OOPS. When needed, I just memorize things and written down in exam :). That worked, I passed the exam but effectively I didn't learn OOP or Object Oriented Programming on those days. It's when, I started learning java (an almost truly object oriented programming language) and introduced to concept like abstract classes, interface, and method overriding; some thing started to going in my mind. This blog post is very basic in nature, but I really hope it could help beginners on understanding things like class, object, abstraction , polymorphism, inheritance ,encapsulation , composition, cohesion, coupling, interface programming etc.

What is difference between Enumeration and Iterator in Java?

Though both Iterator and Enumeration allows you to traverse over elements of Collections in Java, there is some significant difference between them e.g. Iterator also allows you to remove elements from collection during traversal but Enumeration doesn't allow that, it doesn't got the remove() method. Enumeration is also a legacy class and not all Collection supports it e.g. Vector supports Enumeration but ArrayList doesn't. On the other hand Iterator is the standard class for iteration and traversal. By the way,  what is difference between Enumeration and Iterator in Java?  This question is from early ages of  Java interview , I have not seen this question on recent interviews but it was quite common during 2000 to 2007 period, now days questions like implementation of HashMap or ConcurrentHashMap etc has taken its place, nonetheless its very important to know the fundamental difference between Iterator and Enumeration. Some time its also asked as Iterator vs Enumeration or Enumeration vs Iterator which is same. Important point to note is that both Iterator and Enumeration provides way to traverse or navigate through entire collection in Java.

What is difference between HashMap and Hashtable in Java?

HashMap vs Hashtable in Java
Though both Hashtable and HashMap are data-structure based upon hashing and implementation of Map interface, main difference between them is that HashMap is not thread-safe but Hashtable is thread-safe. Which means you cannot use HashMap in multi-threaded Java application without external synchronization. Another difference is HashMap allows one null key and null values but Hashtable doesn't allow null key or values. Also thread-safety of hash table is achieved using internal synchronization, which makes it slower than HashMap. By the way difference between HashMap and Hashtable in Java is one of the frequently asked in core Java interviews to check whether candidate understand correct usage of collection classes and aware of alternative solutions available. Along with How HashMap internally works in Java and ArrayList vs Vector, this  is one of the oldest question from Collection framework in Java. Hashtable is a legacy Collection class and it's there in Java API from long time but it got re-factored to implement Map interface in Java 4 and from there Hashtable became part of Java Collection framework. Hashtable vs HashMap in Java is so popular a question that it can top any list of Java Collection interview Question. You just can't afford not to prepare HashMap vs Hashtable before going to any Java programming interview. In this Java article we will not only see some important differences between HashMap and Hashtable but also some similarities between these two collection classes. Let's first see How different they are :

What is difference between Synchronized and Concurrent Collections in Java?

Synchronized vs Concurrent Collections
Though both Synchronized and Concurrent Collection class provide thread-safety, main difference between them is in performance, scalability and how they achieve thread-safety. Synchronized collections like synchronized HashMap, Hashtable, HashSet, Vector and synchronized ArrayList are much slower than their concurrent counterparts ConcurrentHashMap, CopyOnWriteArrayList and CopyOnWriteHashSet. Main reason of this slowness is locking, synchronized collection locks whole object, while concurrent collection achieves thread-safety smartly e.g. ConcurrentHashMap divides the whole map into several segments and locks only on segments, which allows multiple threads to access other collections without locking. CopyOnWriteArrayList allows multiple reader thread to read without synchronization and when their is write happens it copies the ArrayList and swaps. So if you use concurrent collection classes in their favorable conditions e.g. for more reading and less updates, they are much more scalable than synchronized collections. By the way, Collection classes are heart of Java API though I feel using them judiciously is an art. It's my personal experience where I have improved performance by using ArrayList where legacy codes are unnecessarily used Vector etc. JDK 1.5 introduce some good concurrent collections which is highly efficient for high volume, low latency Java application.

What is the use of class “java.lang.Class” in Java?

java.lang.Class is one of the most important class in java but mostly overlooked by Java developers. It is very useful in the sense that it provides several utility methods e.g. getClass(), forName() which is used to find and load a class, you might have used to load Oracle or MySQL drivers. It also provides methods like Class.newInstance() which is the backbone of reflection and allow you to create instance of a class without using new() operator.  Class has no public constructor and it's instance is created by JVM when a class is loaded. Object of class Class is also used to represent classes, enum, interfaces and annotation in a running Java application. The primitive types e.g. byte, short, char, int, float, double and boolean are also represent by Class instances. You can get the corresponding Class instance by using class literals e.g. int.class, float.class or boolean.class. It is also used to represent instance of array in Java. Every array with same type and same dimension share same instance of class Class. Another use of java.lang.Class is while implementing equals() method to check whether two objects are of same type or not.

Why Comparing Integer using == in Java 5 is Bad?

Java 5 introduced auto-boxing which automatically converts int to Integer and because of that many Java developers started writing code for comparing int variable to Integer object and Integer to Integer using == operator. You should avoid that because it can create subtle bugs in your program because it only works for a particular range of integers and not for all. There is another problem as well, when you compare int variable to Integer object using == operator, the Integer object is converted to primitive value. This can throw null pointer exception if the Integer object is null, which can crash your program. Now when you compare two Integer object using == operator, Java doesn't compare them by value, but it does reference comparison. When means even if the two integer has same value, == can return false because they are two different object in heap. That's why you should use equals() method to compare objects. There is one more point which makes thing tricky, caching of integer objects by Integer.valueOf() method. What this mean is that your program will work for some input but not for others. This happens because auto boxing uses Integer.valueOf() method to convert Integer to int and since method caches Integer object for range -128 to 127, it return same Integer object in heap, and that's why == operator return true if you compare two Integer object in the range -128 to 127, but return false afterwards, causing bug. Before Java 1.4 that was not a problem because there was no autoboxing, so you always knew that == will check reference in heap instead of value comparison.

How do you find length of a Singly Linked list

Hi Guys,

Here is one of the classical questions asked to me on an interview with multinational Investment bank after that this question asked to me on several times in other interviews also . what makes this question interesting is that java developers are not that great with data structure relative to C++ developer which is obvious because of fundamental difference between this two language.C++ is more of system programming language while java is more on application programming , also rich set of java API allows programmer to skip this kind of basic programming techniques.

How to check if a thread holds lock on a particular object in Java

Think about a scenario where you would have to find at run time that whether a java thread has lock on a particular object e.g. find out whether thread NewsReader has lock on NewsPaper object or not ?

How to check if a thread holds lock in JavaIf this questions came in any core java interview then I would automatically assume that there could be at least two answer one is hard earned raw answer which programmer would like to figure out based on fundamentals and other could be some rarely used API calls which is available in java , by the way this is actually asked to me in an interview of one of the biggest global bank.

Why String is Immutable or Final in Java

String is Immutable in Java because String objects are cached in String pool. Since cached String literals are shared between multiple clients there is always a risk, where one client's action would affect all another client. For example, if one client changes the value of String "Test" to "TEST", all other clients will also see that value as explained in the first example. Since caching of String objects was important from performance reason this risk was avoided by making String class Immutable. At the same time, String was made final so that no one can compromise invariant of String class e.g. Immutability, Caching, hashcode calculation etc by extending and overriding behaviors. Another reason of why String class is immutable could die due to HashMap. Since Strings are very popular as HashMap key, it's important for them to be immutable so that they can retrieve the value object which was stored in HashMap. Since HashMap works in the principle of hashing, which requires same has value to function properly. Mutable String would produce two different hashcodes at the time of insertion and retrieval if contents of String was modified after insertion, potentially losing the value object in the map.