Mule ESB runtime is light weight java based Enterprise Service Bus, which can be integrated between different platforms and languages that can connect fast and communicate between each other.Mule ESB can be deployed anywhere and can orchestrate real time events.

Mule ESB has got below capabilities.

Service creation and hosting — expose and host reusable services, using the ESB as a lightweight service container

Service mediation — shield services from message formats and protocols, separate
business logic from messaging, and enable location-independent service calls

Mule and other ESBs offer real value in scenarios where there are at least a few integration points or at least 3 applications to integrate. They are also well suited to scenarios where loose coupling, scalability and robustness are required.

Below is a quick ESB selection checklist. To read a much more comprehensive take on when to select an ESB, read this article written by MuleSoft founder and VP of Product Strategy Ross Mason: To ESB or not to ESB.

1. Are you integrating 3 or more applications/services?
2. Will you need to plug in more applications in the future?
3. Do you need to use more than one type of communication protocol?
4. Do you need message routing capabilities such as forking and aggregating message flows, or content-based routing?
5. Do you need to publish services for consumption by other applications?

Why Mule?

Mule is lightweight but highly scalable, allowing you to start small and connect more applications over time. The ESB manages all the interactions between applications and components transparently, regardless of whether they exist in the same virtual machine or over the Internet, and regardless of the underlying transport protocol used.

There are currently several commercial ESB implementations on the market. However, many of these provide limited functionality or are built on top of an existing application server or messaging server, locking you into that specific vendor. Mule is vendor-neutral, so different vendor implementations can plug in to it. You are never locked in to a specific vendor when you use Mule.

Note: the above two paras are directly taken from Mule website because i feel thats most apt content than i can describe.

In the next comming blog posts i will teach you how to start with mulesoft ESB.
Happy Mule 🙂

Hi All, first of all “A very Happy New Year” to every one. Today we are doing to an awesome tool “Apache Drill” which is made to query any NoSql Database if the form of tables even though the tables does not exist. With ‘Drill’ we can start querying any non relational database just like relational database. Apache Drill supports almost all NoSql databases and filesystems like HBase, Hadoop File System, MongoDB, Hive, MapR-DB and Amazon-S3 and many more.
We start trating our JSON data just like table data event when its not.
Drill features a JSON data model that enables queries on complex/nested data as well as rapidly evolving structures commonly seen in modern applications and non-relational datastores. Drill also provides intuitive extensions to SQL so that you can easily query complex data.(credits Apache Drill page.)

Now let us see how to install Apache Drill on you local machine and how to configure it with MongoDB.
1. Download and install Apache Drill from here
2. Download MongoDB from here

once downloaded and installed both of the software, we shall start Apache Drill first.

Step1 : Navigate to /bin/ in command prompt
Step2 : now type the following command sqlline.bat -u “jdbc:drill:zk=local”
your Apache drill should start with out any errors as shown below.

once the Apache drill server is up and running then start the Web Console by hitting the following url.
Step3 : http://localhost:8047/

once you have the web console ready, please go to storage menu and enable mongodb plugin by putting the following content. ensure your mongodb server is up and running before this step is done.
{
“type”: “mongo”,
“connection”: “mongodb://localhost:27017/”,
“enabled”: true
}

once done we can start querying the mongodb same as relational database as shown below.

The same results in mongodb client shell as shown below.

Thats all folks, you have successfully configured Apache Drill with mongoDB. in my next post will be integrating Apache drill to Java and query MongoDB.

Aspect oriented Programming is a cross cutting concepts to OOP. AOP in Spring is used in replacement to EJB for it’s declarative programming style. in this tutorial we will look into different advices that AspectJ supports in Spring.

First of all an Advice is a functionality that we want to execute before or after some method is getting executed.
There are 4 types of Advices that Spring Supports.

BeforeAdvice : this advice is executed before every method call

AfterAdvice : this advice is executed after every method call. please note that this will not get executed if a method throws some exception

AfterThrowingAdvice : this advice is executed after every method throws some configured exceptions

AroundAdvice : this advice is executed before and after every method call

let us dive directly to code part as the above explanation is straight forward.Step1: Let us look into POM.xml file

now let us start writing the classes that were shown in the above configuration file.Step3: write a class named BeforeAdvice.java which will implement MethodBeforeAdvice.java interface. this interface has before method which gets executed before every method call

That’s it guys we have finished coding advices in spring.practical scenario : this kind of approach is very much useful while writing logging facility in projects.
please test the code on your own, and let me know if anything is needed.

Hello everybody, its a long gap that i have not written a post in my blog. This post could be my last post in 2015. today we are going to see how to integrate Spring’s one of the best feature Spring Boot with Spring data and MongoDB.

Step 4: create the controller class which can handle the request coming from client. in this example the controller is called GlobalController.java. The controller class is autowired with MongoTemplate Object and StudentRepository, so let us create StudentRepository so that it will get injected into the controller, when the class loads to spring container. MongoTemplate is readily configured in the AppConfig.java file.

Hi All, These days we hear a lot of buzz in and around the IT industry regarding the BigData and NoSql. Here in this post i wanted to show you how to setup multi node cluster on single machine(Windows).

In Windows machine please navigate to “C:\Windows\System32\drivers\etc” and edit the “hosts.etc” file and add the following content as below.

once we add the cassandra nodes to hosts.etc file, please download the latest version of Apache Cassandra from the following sitedownload cassandra once downloaded please extract that to one of the folders as “appache-cassandra-2.1.6-node1″(similarly, extract 3 different copies of the same zip file to 3 different folders).

once you are ready with Cassandra folders now its time to modify the cassandra config file located in /conf/cassandra.yaml file.
please edit the following values in the config file

cluster_name: 'DemoCluster'

Provide the seed nodes for each cassandra.yaml file as 127.0.0.1 and 127.0.0.2 etc.;

seed_provider: # Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes! - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: "127.0.0.1,127.0.0.2"

Note: You need to ensure that the following values are changed for each node
directories where Cassandra should store data on disk

Hello everybody, this time i took little long time to post an article here. Here i came up with a very powerful integration pack called “Integration of Spring data rest with AngularJS and MongoDB”. Now a days this combination is best suited for SPA – “Single Page Application” with light weight back end support with mongodb. Now we will have a Jump start into the tutorial. this tutorial will assume the prior basic knowledge of

Java8

Spring & Spring Data Rest

MongoDB

the project structure looks as below.

Before proceeding with the Spring integration with angularjs and mongodb, please install mongodb and start the mongodb server. if everything goes well server startup should look as below.

Now install any GUI client for mongodb for easy access, we can even access mongodb with out client but this is for better user experience. I personally use “Robomongo” and once you connect Robomongo to MongoDB server that will look as below.

Once everything is ready and inplace, let us start with writing the code. I have used Maven to manage the dependencies and hence the pom.xml looks as below.

With the above two files we are done with the configuration part. Let us talk about ApplicationConfig.java a little more in deep. At the top of the class please take a close look, i have annotated the class with “@EnableWebMvc”, which will enable all “@Component” based class and scans them when the application is loaded by the web container. The annotation “@EnableWebMvc” is equivalent to “”. Moving little forward “@ComponentScan” will scan all the @Component based classes. Now comes the “@EnableMongoRepositories” which will load all the repositories. Finally we have imported a core class from the Spring API called “RepositoryRestMvcConfiguration” this is the class responsible for converting the domain objects back and forth to JSON format and acts as a communication bridge between clint(browser) & backend. In this class we have innitialised two beans called “MongoDBFactory” & “MongoTemplate” since if we have any operation to do apart from Repository implementation then we can use of “MongoTemplate” object to fulfill that.

Here comes the exact repository that we were talking from little while. Please observe the repository carefully. Its an interface extending one more interface called “MongoRepository”.The goal of Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores.The central interface in Spring Data repository abstraction is Repository (probably not that much of a surprise). It takes the domain class to manage as well as the id type of the domain class as type arguments. This interface acts primarily as a marker interface to capture the types to work with and to help you to discover interfaces that extend this one. The CrudRepository provides sophisticated CRUD functionality for the entity class that is being managed. MongoRepository extends the basic CrudRepository.

Now we done with the java part and now its time for us to write the Html and java script. please download latest AngularJS library and include the “angular.min.js” inside your project, after including please write a file called “mongo.module.js” and out the following content into it.

/**
*
*/
var myApp = angular.module('myApp', ['controllers']);

Now write an AngularJs controller which is responsible for firing the Ajax request to the Spring and get the data in REST format. create a folder called “controllers” and create a file “controllers.js” and put the following content into it.

That is it guys we are done from coding part and its time for us to build the application and deploy it to server.
Once we deploy the application into the server, please install an Add on to firefox or chrome called “RESTClient” from which we can test our repositories are working or not.

Once you fire the request as shown in the above screen shot, we should get the response from the service as below.

Now try to open our page “index.html” and in firebug console we could see the same response as above which means pur angularjs is firing the request and our Spring repositories are responding to the request.