23
www.opencredo.com Spring Integration 1.0.X and whats coming in 2.0 Jonas Partner OpenCredo Principle Consultant Spring Integration Committer Tuesday, 20 October 2009

Spring Integration

Embed Size (px)

Citation preview

Page 1: Spring Integration

www.opencredo.com

Spring Integration 1.0.X and whats coming in 2.0

Jonas Partner OpenCredo Principle Consultant

Spring Integration Committer

Tuesday, 20 October 2009

Page 2: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Agenda

• Enterprise Integration Patterns• Why Spring Integration• What Spring Integration provides• Whats new in SI 2.0• Questions

Tuesday, 20 October 2009

Page 3: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Enterprise Integration Patterns

• Book by Gregor Hohpe and Bobby Wolf• Documents

– Styles of Integration database, file, messages and channels

– Patterns• Splitter• Router• Transformer

Tuesday, 20 October 2009

Page 4: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Messages

Generic package for data (the Message payload) that can be transported via channels

Headers provide information to other components that consume from channelsSequence Number

Sequence Size

...

Headers

Payload

Tuesday, 20 October 2009

Page 5: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Channels

Channels deliver messages from producers to consumers

Producer Channel Consumer

Tuesday, 20 October 2009

Page 6: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Why use messaging 1/2

• Louse coupling– Localise impact of changes– Improve separation of concerns

• Easy Interception– Mediation– Filtering– Reroute

Tuesday, 20 October 2009

Page 7: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Why use messaging 2/2

• Performance– Less blocking since async– Efficient use of resources

• Threads• DB Connections

– More effective use of multi core processors

Tuesday, 20 October 2009

Page 8: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Agenda

• Enterprise Integration Patterns• Why Spring Integration• What Spring Integration provides• Whats new in SI 2.0• Questions

Tuesday, 20 October 2009

Page 9: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Why Spring Integration

• Spring goodness in the integration space– Light weight, not a server– Non invasive POJO programming model– Builds on strong foundation, Spring

• Reusable Enterprise Integration Pattern implementations

• Message and Channel approach useful for non integration applications

Tuesday, 20 October 2009

Page 10: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Light Weight

• Spring Integration != Spring ESB• Simply components in applications context

– Wiring together through dependency injection– Channels beans, adapters beans ...– Follows application context lifecycle

• Simple adoption

Tuesday, 20 October 2009

Page 11: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Agenda

• Why Spring Integration• Enterprise Integration Patterns• Spring Integration provides

– Enterprise Integration Patterns implementation

– Message and Channel framework– Adapters

• Whats new

Tuesday, 20 October 2009

Page 12: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Transformer

@Transformer public Document convert(Document doc){ return convertToNewFormat(doc); }

Tuesday, 20 October 2009

Page 13: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Splitter

@Splitter public List<Document> orderItems(Document doc){

return splitOrder(doc); }

Tuesday, 20 October 2009

Page 14: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Router

@Router public String resolveDrinkChannel(Drink drink) {

return (drink.isIced()) ? "coldDrinks" : "hotDrinks"; }

Tuesday, 20 October 2009

Page 15: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Chain

<chain input-channel="input" output-channel="output"> <filter ref="someSelector" throw-exception-on-rejection="true"/> <header-enricher error-channel="customErrorChannel"> <header name="foo" value="bar"/> </header-enricher> <service-activator ref="someService" method="someMethod"/> </chain>

Tuesday, 20 October 2009

Page 16: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Agenda

• Why Spring Integration• Enterprise Integration Patterns• Spring Integration provides

– Enterprise Integration Patterns implementation

– Message and Channel framework– Adapters

• Whats new

Tuesday, 20 October 2009

Page 17: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Adapter

Tuesday, 20 October 2009

Page 18: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Current Adapters

• JMS• RMI• Http Invoker• HTTP• File• Spring Web Services• Mail Spring Application Events

Tuesday, 20 October 2009

Page 19: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Agenda

• Why Spring Integration• Enterprise Integration Patterns• Spring Integration provides

– Enterprise Integration Patterns implementation

– Message and Channel framework– Adapters

• Whats new in 2.0

Tuesday, 20 October 2009

Page 20: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Spring Integration 2.0 1/2

• Due late this year– JDBC– Twitter??– Suggestions/requests/contributions

• Improved testing framework• Spring 3.0 expression language

Tuesday, 20 October 2009

Page 21: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Spring Integration 2.0 2/2

• XQuery• JMS Backed channel (not an adapter)• Other patterns

– Claim Check– Scatter Gather– Process Manager....

Tuesday, 20 October 2009

Page 22: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Also Spring Extensions

• Home to FTP adapters and other contributions – http://www.springsource.org/extensions/

se-sia• Spring Integration .Net

– http://www.springsource.org/extensions/se-springintegration-net

– Nearly a port of java.util.concurrent http://www.springsource.org/extensions/se-threading-net

Tuesday, 20 October 2009

Page 23: Spring Integration

© 2009 Open Credo Ltd www.opencredo.com

Questions and the usual book plug

Tuesday, 20 October 2009