Posts

Showing posts from 2012

Spring JMS Tutorial with ActiveMQ

Image
In this post I'll look at Springs messaging support and how it can be used to integrate with Message Oriented Middleware (MOM) offerings such as Apache ActiveMQ. Although the sample application in this post will use ActiveMQ as its message broker, the application itself is vendor agnostic and can  integrate with any JMS compliant messaging platform. I've kept the application as loosely coupled from ActiveMQ as possible and will highlight the bits that would need to change if you were to choose another message platform such as IBM MQSeries.

Technologies Used
The sample code in this post will be built and deployed as a simple web application. Obviously this doesn't have to be the case but I've chosen to build a web app as these type of enterprise integration components tend to be deployed as web applications in the real world. The sample app will be built using the following stack. Apache ActiveMQ - JMS Message Broker(not part of the actual application but used to test our…

Spring Quartz Tutorial

Image
In this post I’ll show you how to use Quartz scheduling with a Spring application. Quartz can be easily integrated with Spring to invoke schedule tasks that call your existing business logic. One of the things I really like about Springs support for Quartz is that you don't have to write any Quartz specific code or amend your existing code to use Quartz scheduling. You simply configure Quartz alongside your existing bean definitions and point it at the logic that you'd like to invoke.

Technologies Used
Our Spring/Quartz example will be built as a stand alone Java application using the following. Spring 3.1MavenQuartz 1.6 It is assumed that readers have a basic knowledge of Spring and Maven. To help you get an example running quickly I’ll add a link to the full source code at the bottom of this post. Once you download the Maven project simply import it into Eclipse and run a Maven build.

Creating a simple Project
We'll start off by creating a very simple Spring project like …

Spring REST Tutorial

Image
Update
I've just written an updated tutorial for building a RESTful services with Spring Boot. Have a look here.

In this post I’ll show you how to implement a RESTful web service using the Spring framework. REST support was introduced as part of Spring 3 and is built on top of the existing Spring MVC stack, so anyone that has worked with Spring MVC in the past should find the REST support very easy to grasp. I’ll provide a step by step guide so even if you’re not familiar with Spring MVC you should be able get a RESTful service up and running quickly.
What is REST? REST is an architectural style that has evolved from existing web technologies to allow client applications to communicate with a server using a simple and familiar approach. The approach is familiar because REST is built on top of the HTTP protocol, a protocol that has formed the backbone of the web for years. REST leverages the existing capabilities of HTTP and uses them to provide an architectural approach for implementi…