Spring & messaging

Post on 19-Oct-2014

851 views 2 download

Tags:

description

Show how messaging is involved in the Spring projects. Demonstrate Spring Integration advanced topics, What's New, What Next. Introduction to Spring XD, Web Sockets and Reactor

Transcript of Spring & messaging

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

The next developmentgeneration

with Artem Bilan

by Pivotal

Spring & Messaging:

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Artem Bilan

abilan@gopivotal.com

Spring Integration Team

Spring FrameworkSpring AMQP

Spring XDReactor

https://github.com/artembilanhttp://www.linkedin.com/in/cleric

https://spring.io/team/artembilan http://stackoverflow.com/users/2756547

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Messaging and why do I care?

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Messaging is very simple

Headers

Payload

public static void main(String[] args) {...}

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

WEB

Controllers, REST,WebSocket

INTEGRATION

Channels, Adapters,Filters, Transforms

BATCH

Jobs, Steps,Readers, Writers

BIG DATA

Ingestion, Export,Orchestration, Hadoop

DATA

NON-RELATIONALRELATIONAL

CORE

GROOVYFRAMEWORK SECURITY REACTOR

GRAILS

Full-stack, Web

XD

Stream, Taps, Jobs

BOOT

Bootable, Minimal, Ops-Ready

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Messaging in Spring IO

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Integration

Meet IoC!

Uses

Written

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

The heart of Spring Integration

– Endpoints (Filters) connected through– Channels (Pipes) exchanging– Message

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

How does it work?

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

• SpEL, SpEL, SpEL …• Scripting (Groovy, JSR223)• Request Handler Advice• Transaction Synchronization• Error Handling• Channel Adapters Correlation• Lifecycle and Control Bus• Message Store Serialization• JMX Exposing

Spring Integration: Advanced

• Adapter, Adapter, Adapter …• SecurityContext Propagation• Payload Cloning• IMAP SearchTermStrategy• FileLocker• Scatter-Gather• Routing Slip• Message Broker• Process Manager• Multitenancy

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Retry -> tx; tx - > Retry

inbound-adapter->poller->http-gateway1->http-gateway2->jdbc-outbound-adapter

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Cache Advice

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Transaction Synchronization

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

HTTP Proxy

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

• 1000 & 1 bug fix• 256 refactoring• 125 improvement• 1 new feature

• Spring 4 compatibility• Jackson 2 support• Syslog adapters• TCP/IP Events• HTTP RequestMapping• SpEL customization• ‘id’ for chain black box• …

Spring Integration 3.0: What’s New?

Joke!

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

@RequestMapping

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

@RequestMapping by Spring Integration

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Expression Language

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

SpEL: EvaluationContext

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

SpEL Customization: high-level API

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

SpEL Customization: high-level API

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring XD

• Unified Platform• Developer Productivity• Modular Extensibility• Distributed Architecture• Portable Runtime • Hadoop Distribution Agnostic• Proven Foundation • XD = ‘eXtreme Data’

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

TapsCompute

HDFS

Wor

kflow

Export

Spring XD Runtime

Inge

st

Jobs

Export

Files Sensors Mobile Social

RDBMS

NoSQL

R, SAS

Spring XD Shell

Streams

Redis

Gemfire

Predictive modeling

Spring XD

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Stream Processing Model

How can we make this easier?http | filter | file

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

XD Runtimes

http | filter | file

Rabbit, Redis, (Pluggable)

XD Admin

CLUSTERED NODE

FilterModule

CLUSTERED NODE

HTTPModule

CLUSTERED NODE

FileModule

In MemoryTransport

http | filter | file

SINGLENODE

AllModules

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Integration 4.0: What Next?

• Spring 4 Platform• Java DSL• New EIP Patterns• New Adapters• Concurrency Improvement• Clustering Features• ???

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Framework 4.0: Websockets

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Framework 4.0: Websockets

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

• Foundation• Distillation best-practices• Lightweight• Event routing• Fully asynchronous• Pattern based• Clear API

Reactor

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Dispatchers, Events, Selectors, Streams, Promises, etc.

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Reactor – Landscape

Spring Integration

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Spring Integration + Reactor

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

Learn More. Stay Connected.

• Spring IO: https://spring.io/platform• GitHub: https://github.com/spring-projects• Spring Integration: http://projects.spring.io/spring-integration• Spring XD: http://projects.spring.io/spring-xd• Reactor: https://github.com/reactor• Spring WebSockets: http://assets.spring.io/wp/WebSocketBlogPost.html• EIP: http://www.eaipatterns.com• Spring Batch: http://projects.spring.io/spring-batch• Spring for Hadoop: http://projects.spring.io/spring-hadoop• Groovy: http://groovy.codehaus.org

© 2013 Pivotal Inc. All rights reserved. Do not distribute without permission.

ありがとう