25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 20<br />

Your First <strong>Spring</strong> XD Application<br />

The last quarter of 2013 saw the release of the first milestone of <strong>Spring</strong> XD. The <strong>Spring</strong> <strong>Framework</strong> and <strong>Spring</strong> XD team<br />

have been working very hard to include more features into this new <strong>Spring</strong> module. But what exactly is <strong>Spring</strong> XD?<br />

<strong>Spring</strong> XD is based on enterprise integration patterns and is based on the <strong>Spring</strong> Integration and <strong>Spring</strong> Batch<br />

modules. They play very nicely not only with Java but also with Groovy and <strong>Spring</strong> Boot. <strong>Spring</strong> XD is a service<br />

for real-time analytics, data ingestions, batch processing, and data export, and it provides a DSL (domain-specific<br />

language) for easy interaction. Also, it can work in single or distribute mode, making it more robust and extensible.<br />

It can also be used along with several technologies, like Hadoop, GemFire XD, RabbitMQ, Redis, etc.<br />

Installing <strong>Spring</strong> XD<br />

Let’s start by installing <strong>Spring</strong> XD. There are different ways to install <strong>Spring</strong> XD. One of the most common way is just to<br />

download the distribution and unzip it in any directory, set some environment variables, and that’s it. You will need to<br />

make sure that you have at least JDK 6 installed, but JDK 7 is recommended.<br />

Using the <strong>Spring</strong> XD Distribution<br />

Download the distribution from http://repo.spring.io/simple/libs-milestone-local/org/springframework/<br />

xd/spring-xd/1.0.0.M7/spring-xd-1.0.0.M7-dist.zip (this is the latest at the time of writing). Unzip it and set the<br />

XD_HOME variable to point to \spring-xd\xd. This installation can be Windows or any<br />

UNIX flavor.<br />

Using OSX Homebrew Installation<br />

Homebrew is one of the best package managers for the OSX (you can find it and install it from http://brew.sh/) and<br />

is recommended because you can run several versions without disrupting others. The following commands will install<br />

spring-xd:<br />

$ brew tap pivotal/tap<br />

$ brew install sprinxd<br />

These commands will install <strong>Spring</strong> XD at /usr/local/Cellar/springxd/1.0.0.M7 and the executable will be<br />

linked to /usr/local/bin.<br />

Now you are ready to start the <strong>Spring</strong> XD service, but first you need to know some useful features that <strong>Spring</strong> XD<br />

supports.<br />

277

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!