• No results found

EAI and Spring Integration. Josh Long Architect, Software Engineer JoshLong.com

N/A
N/A
Protected

Academic year: 2021

Share "EAI and Spring Integration. Josh Long Architect, Software Engineer JoshLong.com"

Copied!
42
0
0

Loading.... (view fulltext now)

Full text

(1)

EAI and Spring Integration

Josh Long

Architect, Software Engineer

JoshLong.com

(2)

Who am I?

Josh Long

A developer with an architect's hat on

Blog: www.joshlong.com

Artima.com Blog:

http://tinyurl.com/4czgdw

(3)
(4)

Agenda

Talk a bit about EAI

Give a Brief History of EAI

Enumerate the capabilities of an ESB

Talk to you about what the landscape of ESBs

Introduce Spring Integration

(you can cheer)

Introduce a case study: a user management service

Show some code and a demo

(5)

What is EAI

Enterprise Application Integration

Been around for as long as disparate computing

paradigms have

EAI is integration of services and / or data.

Enterprise Application Integration platforms have

changed names

Now known as: an Enterprise Service Bus (ESB)

 Please update your buzzword dictionary.

Types of EAI:

File Transfer

Shared Database

Remote Procedure Call

(6)

Common ESB Capabilities

Location Transparency

Transport Conversion

Message Transformation / Routing / Enhancement

Security

Spring Security integration‟s on the roadmap

Monitoring and management

you might use JMX for Spring Integration

Process management (BPMs, orchestration)

Complex Event Processing

(7)

DO NOT USE:

 The foundation of all SOA architectures

 They encourage the creation of centralized

silos of information and services

 This is anti-SOA

 Best used with an eye towards exposing

hidden applications and services

 Not the fastest solution since, by definition,

they're a level of indirection

USE:

 You'd use an ESB to integrate applications and

data that don't naturally fit well together.

 Reduce architectural spaghetti

(8)

How do JEE solutions stack up on…

• Messaging

• RPC

• Integration with Homogeneous Systems

• Integration with Heterogeneous Systems

• Mainframe systems?

• Security

• Flexible routing

(9)

Spring Integration

Spring Integration is a new addition to the Spring Portfolio

 Provides support for SOA, EDA and EAI

 Too many buzzwords?

It just went live with a 1.0 late in 2008.

Provides philosophical consistency with core Spring

principles.

 Spring Integration is an API geared towards building ESB -centric

(10)

The ESB Landscape

Traditional EAI solutions from

the likes of TIBCO, Axway,

WebMethods

Open source / Java-centric

solutions like ServiceMix,

PEtALS, OpenESB, JBossESB,

Mule (

and of course Spring Integration

)

The alternatives: solutions

strung together with bailing wire

and tape, a veritable Rube

Goldberg machine

* Rube Goldberg solution --you’ve never built something like this, have you? Really??

(11)

Case Study: Introduction

The application is the central user authorization and

management hub for all customers in the suite

Plans include provision of single sign on, etc

Needs to be flexible in the future.

(12)

Case Study: History

Version 1.0

 Written on „raw‟ JEE 1.4

 Remoting provided by EJB 2.x

 ORM-ish functionality achieved using CMP Entity Beans  Development took 1,000 rat years

Version 2.0

 Fundamental pieces were reworked

 No rats were harmed. Developers, however…

Version 3.0

(this is the one we‟re going to address…)

 Provide integration with newly assimilated PHP site /

application.

(13)

Case Study: 3.0 Analysis

Provide integration with PHP Site

 Application already supports CSV exports  Third party: don‟t have the source

Provide faster integration with Java application

 The Java application gets too much traffic;

enrollments can't keep up.

 Use temporal decoupling: buffer the requests

(14)

Existing Architecture

(15)

Envisioned Architecture

(16)

Let's use an ESB!

(17)

Spring Integration Solution

DEMO

(18)

Spring Integration uses standard Spring XML

Idiomatic configuration: annotations, schema.

DSLs to go

Spring Integration is embedded: deploy Spring

Integration with your app; you don‟t deploy your

application to Spring Integration

(19)

A little background information:

(20)

You'll typically deal with three things in an

integration solution:

Channels

Endpoints

Adapters

(21)

Spring Integration

{your code here}

This all happens in a Spring Application Context, just like any

other Spring configuration:

(22)

Spring Integration

Channels: In xml:

Pretty useless.

It's just an abstract concept at this point.

Something to connect to, but no real indication is

provided as to how.

(23)

Adapters:

In xml:

We need to connect something to this channel.

An adapter knows how to deal with some external

system

(24)

Service Adapter:

In xml:

This allows you to invoke java code as a result of

a message of a certain type arriving.

(25)

Spring Integration Solution

(26)

Spring Integration Solution

File Drop Solution (XML)

}

channels

}

beans

(27)

Spring Integration Solution

File Drop Solution (XML)

}

beans

Declaring a few beans that contain annotations. This makes Spring recognize them

(28)

Spring Integration Solution

File Drop Solution (XML)

}

channels

(29)
(30)

Spring Integration Solution

Take a look at the beans themselves.

File Solution (Java): The Splitter:

(31)

Spring Integration Solution

Take a look at the beans themselves.

File Solution (Java): The Transformer:

(32)

Spring Integration Solution

Take a look at the beans themselves.

(33)

Spring Integration Solution

Configuration for the JMS client. You'd write this whether you were using Spring

Integration or not.

(34)

Spring Integration Solution

1: tells SI to pop messages off the JMS queue 2: tells SI to transform incoming JMS messages

into EnrolledUsers.

3: tells SI to call the same service activator that

we saw last time, and call enrollments.

JMS Solution (XML)

The relevant XML

(35)

Spring Integration Solution

Let's again take a look at the beans themselves:

JMS Solution (Java): The Transformer

(36)

Where to go From Here: Spring Batch

• Spring Batch

• Spring Batch provides a standard infrastructure for batch processing (i.e., large data payloads)

• Data can be partitioned and processed in chunks, which then might be fed to an event bus.

• The reason for this is simple: Spring Integration encourages a (Staged) Event Driven Architecture, but a file with 20 million rows isn‟t an event. It‟s too coarse. Use Spring Batch to make manageable.

• The other way around is possible too:

• The ESB may produce output that, taken together, is too large or that would be better suited for batch processing infrastructure.

• You might use a correlation ID to have a processed message re-enter the bus and resume processing or routing.

(37)

Where to go From Here: Workflow

• jBPM and Spring Modules Support

• Spring Batch can glue disparate subsystems together, enabling the components to send messages.

• Once inside one subsystem, however, complex, stateful processing may be required.

• Nested states, recursion, etc

• An ESB is not ideal for very complex state management; messages are either going in or out.

• Use a workflow engine (JBoss jBPM is a fine example) to

handle complex management of the message and application state.

• You might use a correlation ID to have a processed message re-enter the bus and resume processing or routing.

(38)

Mark Fisher, Iwein Fuld and the SI developers for

framework and support

“Enterprise Integration Patterns”

“Open Source ESBs in Action”

(39)
(40)

The

(41)
(42)

References

Related documents

Outputs impact and indicative Activities (Strategy) Type of Input/Timin Cost in USD Intended Activities 9/Relations Results hip with other I Partners ———— 1-• 30,000 Desk

Comparative efficacy and acceptability of antidepressants, psychological interventions, and their combination for depressive disorder in children and adolescents: protocol for

We discuss our initial experiences in using the Babel Fortran 2003 binding when calling legacy Fortran codes from the FACETS (Framework Application for Core-Edge Transport

Schindl M, Schoppmann SF, Samonigg H, Hausmaninger H, Kwasny W, Gnant M, Jakesz R, Kubista E, Birner P, Oberhuber G, Austrian Breast and Colorectal Cancer Study Group: Over-

Peace Building and Community Development program is a civic engagement program using service learning to create valuable experience for both community partner organizations

The ultimate results are a formal assessment of risk, a disaster recovery plan that includes all available recovery mechanisms, and a formalized Disaster Recovery

Combined with the recent results of approximate dictionary estimation, this yields provable guarantees for exact recovery of both the dictionary elements and the coefficients, when

The night before last, sitting by the fence near the jungle is a ten-minute sound recording made by author and journalist Behrouz Boochani while forcibly detained on Manus