25.02.2015 Views

Introducing Spring Framework

Introducing Spring Framework

Introducing Spring Framework

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 20 ■ Your First <strong>Spring</strong> XD Application<br />

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

<strong>Spring</strong> XD can work in two different modes, single and multi-mode. The single mode can be used for all processing<br />

and administration. The multi-mode is a distributed mode that can spread some jobs and tasks across a cluster of<br />

multiple nodes.<br />

<strong>Spring</strong> XD has some key components, the XD Admin and the XD Container Servers, where the XD Admin<br />

will take a DSL command task and send it over to the XD container servers for processing using different types of<br />

transports (that can be specified at start time) such as in-memory (default), Redis, and RabbitMQ. Figure 20-1 shows a<br />

general <strong>Spring</strong> XD architecture.<br />

Data Processing DSL<br />

XD Admin<br />

Message Queue<br />

Redis<br />

RabbitMQ<br />

XD Container<br />

XD Container<br />

Module<br />

Module<br />

Figure 20-1. <strong>Spring</strong> XD Runtime Architecture (DIRT – Distributed Integration Runtime)<br />

Modules<br />

<strong>Spring</strong> XD supports three types of modules:<br />

Taps<br />

278<br />

• Source: This module polls from an external resource or can be triggered by an event and only<br />

provides an output. This module is always a stream. Out of the box, <strong>Spring</strong> XD provides several<br />

sources: file, gemfire, rabbit, http, mail, jms, etc. You can see the complete list by<br />

executing the command module list on the XD shell (that you run later).<br />

• Processor: This module provides some processing (business logic) or transforming; by<br />

providing an input and one or more outputs. Out of the box, <strong>Spring</strong> XD provides several<br />

processors such as aggregator, http-client, bridge, filter, json-field-extractor,<br />

json-field-value-filter, object-to-json, script, splitter, transform, etc.<br />

• Sink: This module only provides one input and outputs the data to an external resource<br />

to terminate the stream. Out of the box, <strong>Spring</strong> XD provides several sinks such as hdfs<br />

(Hadoop), file, gemfire-json-server, jdbc, mail, splunk, tcp, aggregatecounter,<br />

counter gauge, rabbit, etc.<br />

<strong>Spring</strong> XD provides taps that listen to data while it is being processed by a stream. This is the implementation of the<br />

WireTap pattern (enterprise integration patterns) on the <strong>Spring</strong> Integration module and it is one of the features you<br />

are going to use in your <strong>Spring</strong> application.

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

Saved successfully!

Ooh no, something went wrong!